Hello everyone!
I have the following problem. The user is asked to input some data with the following command:
//declarations:
char a[81];
char b[81];
char c[81];
//user is asked to input three lines of text:
cin.getline(a, 81, '\n');
cin.getline(b, 81, '\n');
cin.getline(c, 81, '\n');
Now, the problem occurs if the user's input is longer than 80 characters.
E.g. if the user inputs a string that is 90 characters long, then he cannot input the preceding lines (b and c). When using:
cout << a << endl << b << endl << c << endl;
the string a is shown as string of 80 characters, but the strings b and c are empty.
Why does this occur?
How to solve this problem?
I cannot force user to input a string that is shorter than, let's say, 80 characters
Thank you in advance!
Bye!