getline(cin, mystring); not working.......
Posted: Thu Jan 06, 2005 3:59 pm
Hi, can you tell me why it is not working?
after I write something and then press "enter", it doesn't work then if I press "enter" again then it takes the input. how can I solve this problem?

Code: Select all
#include<iostream>
#include<string>
using namespace std;
int main()
{
string mystring;
getline(cin,mystring);
cout<<mystring;
return 0;
}