M
Mike Copeland
In the following program, I must press "return" twice when I enter
the string data. Why is that? TIA
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string mystr = "";
cout << "What's your name? ";
getline (cin, mystr);
cout << "Hello " << mystr << ".\n";
return 0;
}
the string data. Why is that? TIA
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string mystr = "";
cout << "What's your name? ";
getline (cin, mystr);
cout << "Hello " << mystr << ".\n";
return 0;
}