Greatly appreciate the help, this one still just exits after the first question regardless of the answer:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
int main(void) {
char q1;
char q2;
cout<<"Welcome to the House of Dies Drear computer quiz!\n";
cout<<"Question 1: Who did Thomas learn was in his dream?\n";
cout<<"A. Pluto\n";
cout<<"B. Mr.Small\n";
cout<<"C. Mrs.Small\n";
cout<<"D. Mayhew\n";
cin>>q1;
if ( q1 == 'a' || q1 == 'A' )
{
cout<<"You are correct!\n";
Sleep(2000);
}
else
{
cout<<"You are incorrect!\n";
Sleep(2000);
exit(1);
}
cout<<"Question 2: Where is the House of Dies Drear located?\n";
cout<<"A. Pennsylvania\n";
cout<<"B. Oregon\n";
cout<<"C. Ohio\n";
cout<<"D. North Carolina\n";
cin>>q2;
if ( q2 == 'a' || q2 == 'A')
{
cout<<"You are correct!\n";
Sleep(2000);
}
else {
cout<<"You are incorrect!\n";
Sleep(2000);
exit(1);
}
return 0;
}
|
Here is the debug output:
'Dies Drear2.exe': Loaded 'C:\Users\Michael\Documents\Visual Studio 2010\Projects\Dies Drear2\Debug\Dies Drear2.exe', Symbols loaded.
'Dies Drear2.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Dies Drear2.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Dies Drear2.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Dies Drear2.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'Dies Drear2.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[9108] Dies Drear2.exe: Native' has exited with code 0 (0x0)