September 2001
Beginner
970 pages
23h 20m
English
When you define a character string array, you must let the compiler know how much space is needed. One way is to specify an array size large enough to hold the string. The following declaration initializes the array m1 to the characters of the indicated string:
const char m1[40] = "Just limit yourself to one line's worth.";
The const indicates the intent to not alter this string.
This form of initialization is short for the standard array initialization form:
const char m1[] = { 'J', 'u', 's', 't', ' ', 'l',
'i', 'm', 'i','t', ' ', 'y', 'o', 'u', 'r', 's', 'e', 'l',
'f', ' ', 't', 'o', ' ', 'o', 'n', 'e', ' ',
'l', 'i', 'n', 'e', '\", 's', ' ', 'w', 'o', 'r',
't', 'h', '.', '\O'
} ;
Note the closing ...
Read now
Unlock full access