Need help with cout!

So when I input my name, Ryan, it says:

Nice to meet you -858993460, have a wonderful day! :)

but Its supposed to say

Nice to meet you Ryan, have a wonderful day! :)

How can I fix this? I cant figure it out.. :/

1
2
3
4
5
6
7
8
9
10
11
12
13
  #include <iostream>
using namespace std;

int main()
{
	int name;
	cout << "Hey there! What is your name?" << endl;
	cin >> name;
	cout << "Nice to meet you " << name << ", have a wonderful day! :)" << endl;

	system ("pause");
	return 0;
}
int name; std::string name;
That did not work :l
Figured it out, I needed to add
#include <string>

thanks!
Topic archived. No new replies allowed.