+ 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
8 Antworten
+ 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;
}
+ 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;
+ 4
make your variables string's
string prenom;
string nom;
that will work for you.
+ 1
in your code now you don't need printIn you want the cout<<
what do you want the output to be?
0
Thank you
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
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
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