G
Gaijinco
Every information about strings seems to be very confusing!
I need a program to read 3 different strings, one after the other all
of them of unknown size. All the strings are separated by and
end-of-line. The first and last don't have whitespace but the last one
has. What is the best method to do this?
I tried this but the program doesn't get the last string:
string line1;
string line2;
char line3[100];
cin >> line1 >> line2;
cin.getline(line3,100);
I need a program to read 3 different strings, one after the other all
of them of unknown size. All the strings are separated by and
end-of-line. The first and last don't have whitespace but the last one
has. What is the best method to do this?
I tried this but the program doesn't get the last string:
string line1;
string line2;
char line3[100];
cin >> line1 >> line2;
cin.getline(line3,100);