when i run this program it skips the
getline. I can change it to a normal
cin, but i'd rather have a
getline.
Code:
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string naam;
char ckeuze;
int hp;
int ehp;
hp = 10;
ehp = 8;
cout << "Voordat we beginnen zou je me je naam willen vertellen? (j of n)" << endl;
cin >> ckeuze;
if (ckeuze == 'j' || ckeuze == 'J')
{
cout << "Vertel hem maar." << endl;
getline (cin, naam); \\ this one skips
} else
{
naam = "onbekende krijger";
}
cout << "Ik heet je welkom, " << naam << ", In de wereld van magie en heldhaftigheid: Terlon." << endl;
system ("pause");
return 0;
}