Copying inputted information?

On the std::cin line where you input your name, I would like your name to appear on the line after the "So your name is.." line but I dont know how to call the inputted information?
1
2
3
4
5
6
7
8
9
10
11
12
13
//test3

#include <iostream>

int main ()

{
	int name;
	std::cout << "Welcome to Carion.\n";
	std::cout << "What is your name:";
	std::cin >> name;
	std::cout << "So your name is.." std::
}
Just as you were outputting your strings to prompt the user for information, you can output variables as well.
std::cout << "So your name is.." << name;

However I see you declared name as an integer, and not, say, a string; was that really what you wanted?

...why did you post the same question twice?
http://www.cplusplus.com/forum/beginner/124509/
Last edited on
Topic archived. No new replies allowed.