I was just curious to know how to create an array of strings. I am looking to make an array of 10 strings and each string can have 20 characters.
#include <iostream>
int main()
{
char a[10] , str[20];
for (int x = 0 ; x<10 ; x++)
{
for (int y = 0 ;y<20; y++ )
{
cout<<"String:";
cin>>str[y];
a[x]=str[y];
}
}
for (int j = 0 ; j<10 ; j++)
cout<<a[j]<<endl;
return 0;
}
Newbie in C++ with an open mind :)