Have Problem

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
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
string answer;
cout<< "what is your favorite book?\n";
cin>> answer;
if (answer == "Pearls Before Swine")
{
cout<<"good job\n";
cin.ignore();
cin.ignore();
return 0;      
}
if (answer != "Pearls Before Swine")
{
cout<< "NOOOOOOOOOO\n";
cout<< " your face is so ugly im shutting down the program\n";
cin.ignore();
cin.ignore();
return 0;
}}


My Probelm is that the program shuts down before you can read the post
can someone help?
#include<conio.h>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
string answer;
cout<< "what is your favorite book?\n";
cin>> answer;
if (answer == "Pearls Before Swine")
{
cout<<"good job\n";
cin.ignore();
cin.ignore();
return 0;      
}
if (answer != "Pearls Before Swine")
{
cout<< "NOOOOOOOOOO\n";
cout<< " your face is so ugly im shutting down the program\n";
getch();

cin.ignore();
cin.ignore();
return 0;
}}
*sigh* Trevor, Why did you use MY cplusplus account for a problem I could have helped you with?
So, kyranstar and kyranstar, does this mean you two solved it?
Yes. It does. Thank you, though.
Topic archived. No new replies allowed.