stupid errors...

ok so i'm trying to run my program and i keep getting 3 errors. the first:
public:
if(cContinue != '0')

the error says "expecting unqualified-id before 'if' "

second:
return 0;
}
"expecting '}' at end of input"

third:
return 0;
}
" expecting unqualified-id at end of input"

i don't understand why these are here :[ can anyone help me?
i'm using codeblocks
closed account (3hM2Nwbp)
You're going to have to paste the whole source for us to help in this case. Be sure to use [ code ]tags[ /code ]
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
45
46
47
48
#include <iostream>
#include <list>
#include <queue>
#include <string>
using namespace std;

class QueueEnter
{
    private:
    queue<string> myqueue;
        string strName;
        char cContinue;
        char cAccess;


        public:
        if(cContinue != '0')
            {
                cout << "Please enter your Name" << endl;
                cin >> strName;
                myqueue.push (strName);
                cout << "Thank you for choosing C++ Bank of America!" << endl;
                cout << "To Accsess the queue, please enter 'A'. Otherwise, please press any key." << endl;
                if(cAccess = 'A')
                    {
                        cout << "" << myqueue.front;
                    }

            }
}

int main()
    {
        cls.QueueEnter;
        cout << "Hello! Welcome to C++ Bank of America! \n" << endl;
        cout << "If you do not wish to wait in line, enter '0' and leave the bank. \n" << endl;
        cout << "If you wish to continue, press any key" << endl;
        cin >> cContinue;

        while(1)
            {
                cls.QueueEnter;
            }



        return 0;
    }


it's still a work in progress. i'm just trying to run it to see where i'm at but those error's keep popping up
Eh?

First, AFAIS, there's no object called cls that has a member called QueueEnter.

Second, you have an infinite while loop at line 40.

Third, everything under public should be in a member function. I do hope you know how to deal with those.

Fourth, you're missing a semicolon at the end of your class declaration.

Fifth, you need an instance of your object to be able to use it.

I hate to be like this, but...are you sure you read the chapter on classes before trying this program?

-Albatross
im coming into the 3rd quarter trying to catch up. also as i stated this is a work in progress. and i just found out from my teacher he doesnt want us using classes so that makes me a much happier person :] thank you though for pointing all this out to me and i will mind it in the future
Topic archived. No new replies allowed.