Possible Duplicate:
Why doesn’t getchar() recognise return as EOF in windows console?
I have a simple problem... Lets say I want to read lines from standart input as long as there is something, but I dont know how many lines it will be. For example I am doing school work and input is
a
ababa
bb
cc
ba
bb
ca
cb
I dont know exactly how many lines it will be, so I tried
string *line = new string[100];
int counter = 0;
while(getline(cin,line[counter]))
{
counter++;
}
But it doesn't work... thanks for help.