Arrays of Strings
Possible to have arrays of strings in C++
char name[5][20];
char name[5][20];
int index;
cout << “Enter 5 names, one per line:\n”;
for (index=0;indexɝindex++)
{cin.getline(name[index],20);}
for (index=0;indexɝindex++)
{cout << name[index] << endl;}
Previous slide
Back to first slide
View graphic version