You asked the same question here (not same, but very similar):
input data into 2d char array[
^]
Since you are using C++, the proper way to do this is using
std::string
. There's rarely a good reason to use
char*
based strings in C++ code.
Quick example:
std::string str[100];
for (int i=0; i<100; i++)
{
cin >> str[i];
}