+ 1

How to put a variable with words time like when you ask someone to put his name and he must save it into these variable

https://code.sololearn.com/cUTP9hv87DMz/?ref=app

4th Dec 2017, 10:03 PM
Physios Game
Physios Game - avatar
8 Réponses
+ 3
then just use: #include <iostream> using namespace std; int main() { string prenom; string nom; cin >> prenom; cin >> nom; cout << "Vous vous appelez donc " << nom << prenom; return 0; }
4th Dec 2017, 10:43 PM
Mooaholic
Mooaholic - avatar
+ 7
instead of 'cin>>stringVariable', use getline(cin, stringVariable). for the translation, you can use equivalents like prénom: firstName mom: lastName vous vous appellez donc: your complete name is therefore. in your output, don't forget to put a space between the first name and the last name like this: cout<<"Your complete name is "<<lastname<<" "<<firstname<<endl;
4th Dec 2017, 11:32 PM
Josué Charles
Josué Charles - avatar
+ 4
make your variables string's string prenom; string nom; that will work for you.
4th Dec 2017, 10:12 PM
Mooaholic
Mooaholic - avatar
+ 1
in your code now you don't need printIn you want the cout<< what do you want the output to be?
4th Dec 2017, 10:28 PM
Mooaholic
Mooaholic - avatar
0
Thank you
4th Dec 2017, 10:19 PM
Physios Game
Physios Game - avatar
0
just an other question so in my output i can see the question I asked so how to fix this sorry for my English but I'm French people
4th Dec 2017, 10:26 PM
Physios Game
Physios Game - avatar
0
I just want to have my name and not the questions I asked where as here I see the question and me I just want to see the answer
4th Dec 2017, 10:36 PM
Physios Game
Physios Game - avatar
0
I'm just a rookie and I don't know the comments like get line string variable can you explain me which is the aims of those instructions and why they are better than the others
4th Dec 2017, 11:36 PM
Physios Game
Physios Game - avatar