Help me

endl will not work for some reason. When i input the name in console it says random numbers instead of out putting the name.

include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main ()
cout << "Hello User, What is your name?" ;
cout << " ";
int name;
cin >>name;
cout << "Hi " << name << "!" ;
cout << " ";

return 0;

You have declared name as an integer, so that's what it will be. Try declaring it as a string if you want a string.
Ok ill try that updates shall continue
ok wait how do i do that
Where it says:

int name;

it should say:

string name;

Also, it is against the rules to have the word "help" in your topic title.
Last edited on
change "int name;" to "string name;"
Last edited on
ok Thankyou and I shall not use help in the title again
It's only a misdemeanor ;)
Topic archived. No new replies allowed.