Initialization of Variables
An external variable may be initialized at compile time
by following its name with an initializing value
The initializing value has to be something whose value is known at compile time,
int x 0; /\** "0" could be any constant \**/
int \**p &y[1]; /\** p now points to y[1] \**/
An external array can be initialized by following its name with
a list of initializations enclosed in braces:
int x[4] {0,1,2,3}; /\** makes x[i] = i \**/
int y[ ] {0,1,2,3}; /\** makes y big enough for 4 values \**/
char \**msg "syntax error\\n"; /\** braces unnecessary here \**/
This last one is very useful _
an array of pointers to character strings,
with a zero at the end so we can identify the
A simple lookup routine could scan this until
it either finds a match or encounters a zero keyword pointer:
lookup(str) /\** search for str in keyword[ ] \**/
for( i=0; keyword[i] != 0; i\*+) {
for( j=0; (r=keyword[i][j]) \*= str[j] && r != '\\0'; j\*+ );
neither local variables nor structures can be initialized.