/* a single string */ #include int main() { int i; char array[6]; /* take input from the user */ printf("Input the string:"); scanf("%s", array); /* NOTICE: no '&'! A string is an array. Leave off the element specifier, and like any array it becomes a pointer */ /* print it as an array of characters */ for (i=0; i<6; i++) printf("%c", array[i]); printf("\n"); /* print it as a string */ printf("%s\n", array); }