I have another problem with a game I'm making, here's the part of the code where it goes funny:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
if (age >= 18)
{
//cin.ignore();
cout << "*ask if playre really wants to continue*" << endl;
getline (cin, yn);
if (yn == "no")
{
cout << "*no action*" << endl;
}
if (yn == "yes")
{
actionchance = rand() % 0 + 6;
cout << "*action*" << endl;
}
}
| |
I have cin.ignore commented because it worked with a similar problem, but not this time. If the string "yn" is answered with "yes", the console will freeze up and Windows (I'm on Windows 7) will give me an error message. If I click on more detail, I'm presented with:
Problem signature:
Problem Event Name: APPCRASH
Application Name: Actual Entity.exe
Application Version: 0.0.0.0
Application Timestamp: 4e540663
Fault Module Name: Actual Entity.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4e540663
Exception Code: c0000094
Exception Offset: 00006d78
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
When I exit out of that window, the console says:
Process returned -1073741676 (0xC0000094)
Than I'll press a button and the console will exit. Does anyone know what's happening or how to fix/ get around it?