Hello i have put this into devshed
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string mystr;
cout << "What's your name? ";
getline (cin, mystr);
cout << "Hello " << mystr << ".\n";
cout << "How old are you? ";
getline (cin, mystr);
cout << "I am" << mystr << " too!\n";
return 0;
}
I run it
It asks me my name, i put it in and press enter
it then asks me how old i am i put my age and press enter and the program closes!
Can somebody tell me why this is happening?