C
chy1013m1
char *testCharArray[] = {
"one",
"two",
"three",
"four",
"five",
"six",
NULL,
};
The above code initializes a NULL terminated char* array. The question
is why is a semi-colon needed after the bracket (ie. }, and why
should there be a comma after NULL ? (I saw in the book beginning linux
programming 3rd ed. the auther appended a comma after NULL, removing
the comma does nothing to the code)
compiler I used was gcc 3.4.4
"one",
"two",
"three",
"four",
"five",
"six",
NULL,
};
The above code initializes a NULL terminated char* array. The question
is why is a semi-colon needed after the bracket (ie. }, and why
should there be a comma after NULL ? (I saw in the book beginning linux
programming 3rd ed. the auther appended a comma after NULL, removing
the comma does nothing to the code)
compiler I used was gcc 3.4.4