September 1998
Intermediate to advanced
848 pages
20h 13m
English
When you define a character string array, you must let the compiler know how much space is needed. One way to do this is to initialize the array with a string constant. With older C implementations, you must use static or external arrays for this purpose, but we'll assume you're using ANSI C and can initialize arrays of any storage class. The following declaration initializes the external array m1 to the characters of the indicated string:
char m1[] = "Just limit yourself to one line's worth.";
This form of initialization is short for the standard array initialization form:
char m1[] = { `J', `u', `s', `t', ` `, `l', `i', `m', `i', `t', ` `, `y', `o', `u', `r', `s', `e', `l', `f', ` `, `t', ...Read now
Unlock full access