I just got into C++ and I wanted to ask some fairly simple questions.
1.
#include <iostream>
using namespace std;
int main()
{
int name;
cout << "What is your name?" << endl;
cin >> name;
cout << "Hello " << name;
system("pause");
return 0;
}
I want it to show me my name but it only shows a number, what am i doing wrong?
When you declared the "name" variable, you declared it as an integer, which will only hold a number. You should use a string, which will store text input:
string name;
You'll need to include the <string> header to use it.