#include <iostream>
usingnamespace std;
int main()
{
char name[51][100];
int a;
cin>>a;
for ( int i = 0; i < a; i++ )
{
cout << "\nEnter sentence: ";
cin.getline( name[i], 99 ); //this null-terminates the array of chars by placing a '\0' at the end of the stream
}
}
Trying adding a cout statement to tell you that you need to input a number for a. Also you may want to flush your input buffer since you are using getline. Here is what I would do in that for loop: