In C, you have to declare the length of an array:
int myArray[100];
But when you’re dealing with chars and strings, the length can be left blank:
char myString[] = "Hello, World!";
Does the compiler generate the length for you by looking at the string?
This is not unique to
char. You could do this, for instance:This is equivalent to writing:
Initialising a
chararray from a string literal is a special case.