vendredi 28 juillet 2017

Beginner C++ - My program doesn't execute one line

So I have this code:

cout << "Please insert the new name: " << endl;
std::string brandNewName;
std::getline(std::cin, brandNewName);

int brandNewSID;
cout << "Please insert the new SID: " << endl;
cin >> brandNewSID;

but my program won't run & execute the line std::getline(std::cin, brandNewName);. It goes directly to the second "cin" and ask for brandNewSID, while not stoping for brandNewName. Why?

Thanks

Aucun commentaire:

Enregistrer un commentaire