2
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by pawan_sharma777
0

You pretty much have it:

char array[]= {"Lara","Lin","Nitin","Krishna","Sophia"};

If you want the names on their own row, then add another dimension to the array:

char array[5][] = { {"Lara"}, {"Lin"}, etc.

0

i use the same but its not work it gave an error " error C2078: too many initializers "
char array[]= {"Lara","Lin","Nitin","Krishna","Sophia"};

0

Sorry.
char *array[]= {"Lara","Lin","Nitin","Krishna","Sophia"};

Add the asterisk! ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.