if and else to string

hello people i started a if and else program but my compiler didnt compile it heres the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <string>
using namespace std;

int main ()
{
    string bot;
    string tob;
    cout << "What letter is this? >> a" <<endl;
    getline (cin, bot);
    if (bot == a)
         cout << "YES CORRECT!" << endl;
    else if (bot == b)
         cout << "hrrrr WRONG WHAT AN IDIOT!" << endl;
    system("pause");
    return 0;
}
can someone help me it said something about leaving A and B undeclared i dont understand..
a is a variable/identifier
'a' is the letter 'a'
"A" is the string "A"

u mean to ad quotes to the answers like this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int main ()
{
    string bot;
    string tob;
    cout << "What letter is this? >> a" <<endl;
    getline (cin, bot);
    if (bot == "a")
         cout << "YES CORRECT!" << endl;
    else if (bot == "b")
         cout << "hrrrr WRONG WHAT AN IDIOT!" << endl;
    system("pause");
    return 0;
}
ohh yeah it did work by leaving a has "a" it did work ahh man thanks
Topic archived. No new replies allowed.