How to declare an array to store the different five(5) name and initialize the following char array with {"Lara","Lin","Nitin","Krishna","Sophia"}
pawan_sharma777
-1
Newbie Poster
Recommended Answers
Jump to PostYou 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.
All 4 Replies
Adak
419
Nearly a Posting Virtuoso
pawan_sharma777
-1
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
pawan_sharma777
-1
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.