This is my first time I post here so I'll try to be clear in my question. So I need to store different string with space in variable. I'm working with eclipse and I have a problem.
This is the code
using namespace std;
string p_theme;
string p_titre;
int p_anneeEdition;
string p_pays;
string p_auteur;
string p_editeur;
string p_isbn;
cout << "Veuillez saisir le thème:" << endl;
getline(cin, p_theme, '\n');
cout << "Veuillez saisir le titre:" << endl;
getline(cin, p_titre, '\n');
....
This is what the console show to me
Veuillez saisir le thème:
Veuillez saisir le titre:
The problem is that I don't have the time to enter the string "Theme" before the second cout. I've tried different way, with a char buffer it didn't work i enter in a loop.
cinandgetline. Here we use formatted output oncout, which shouldn't have any effect on agetlinecall oncin.getline(cin, ...)not waiting for user input, which seems to be exactly the problem reported here. I'm not sure which of us is misreading the question.