[try Beta version]
Not logged in

 
getline problem

Jun 24, 2013 at 7:04pm
when im using getline function (to input a string with spaces) with a for loop till 5 for example it only inputs 4 strings, why is that?
Jun 24, 2013 at 7:18pm
its hard to understand what your asking here, could you please post the source code?
Jun 24, 2013 at 8:34pm
1
2
3
4
5
string s;
for (int i=0;i<2;i++)
{
        getline(cin,s);
}



it only reads one string, why is that?
Topic archived. No new replies allowed.