A string is just a character array with a terminating character ('\0') at the end.
Code:
// explicitly initialize each element of the array
char array_1[6] = {'H', 'e', 'l', 'l', 'o', '\0' };
// initialize the array with a string literal (the compiler will automatically
// add the null character, but it's up to the programmer to leave enough space
// for it in the array!
char array_2[6] = "Hello";
"fgets()" reads in a string and terminates it, but it has the caveat of also storing the newline if there is room.
So to correct your example:
Code:
index 0 1 2 3 4 5 6 7 8 9 10 11
value 1 2 3 4 5 6 7 8 9 0 \n \0
Note that, in my correction, index only goes up to 11. That is because the valid range of "array[n]" is from zero to "n-1".