#include <stdio.h>

char str[]= "TRANS\0FORMERS"; //in questo caso tutto il resto della stringa dopo il terminatore viene ignorato

int main() {
    int i;
    for(i=0; str[i] !='\0'; i++) {  //stampo solo fino al terminatore
                                    //condizione di termine della stringa
                                    //str[i] !=0 è come scrivere str[i] !='\0'
        printf("str[%d] = %c\n", i, str[i]);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: