
Originally Posted by
jamadagni
what is the * for in the first statement?
namelist is an array of strings and strings in C are of char * type.

Originally Posted by
jamadagni
don't I need to write char *namelist[][] (two []-s)?
No, futhermore you can't declare a multidimentional array without specifying dimentions.
int wont_work[][] = { {1,2,3}, {4,5,6} }; // error
int will_work[][3] = { {1,2,3}, {4,5,6} };
int wont_work[][] = { {1,2,3}, {4,5,6} }; // error
int will_work[][3] = { {1,2,3}, {4,5,6} };
To copy to clipboard, switch view to plain text mode

Originally Posted by
jamadagni
is the comma necessary before the closing brace?
No.

Originally Posted by
jamadagni
is the semicolon necessary after the closing brace?
Yes.
Bookmarks