ok, im making a text-adventure game and i have just started but i already have problems!
this is the code:
Code:
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
char name;
cout << "Hello, and welcome to Hatred. This is a text-base RPG so get your\n";
cout << "notepad ready! Press enter when you are ready to begin.\n";
cin.get();
cout << "What would you like to be called? ";
cin >> name;
cin.ignore();
cout << "OK then, " << name << "press enter when you are ready to begin your adventure\n";
cin.get();
}
and what its supposed to do is let me type the name and it will instert it in the next text. but when i press enter after i type the name it just closes. any ideas why?