Page 1 of 1

[SOLVED] C++ program does not compile

Posted: Tue 03 May 2011, 09:41
by mahaju
Hi can anyone please tell me what is the mistake here?

Code: Select all

class D_flipflop(){
    private:
        uint Q, Q_d, D, clk;
//        RS_flipflop a;
    public:
        D_flipflop(){
            D = 0;
//            Q = a.get_Q();
//            Q_d = a.get_Q_d();
            clk = 1;
        }

        D_flipflop(char a){
            if(a=='d') {
                D_flipflop();
                clk = 0;
            }

            else{
//                a.reinitialize('a');
                D_flipflop();
                D = 0;
                clk = 1;
            }
        }

        uint compute(uint d_inp, uint clk){
            D = d_inp;
//            a.compute(D, not_gate(D) );
//            Q = a.get_Q();
//            Q_d = a.get_Q_d();
        }

        uint get_Q(){ return Q; }
        uint get_Q_d(){ return Q_d; }
};

int main(){}
This is the error I get (Codeblocks 8.02

Code: Select all

D:\CB_Files\bit_level_manip\test.cpp|1|error: expected unqualified-id before ')' token|
||=== Build finished: 1 errors, 0 warnings ===|
what does this mean
By the way, please ignore the object of class RS_flipflop for now, I need to get this piece of code to compile first

Posted: Tue 03 May 2011, 13:09
by mahaju
I had made a really stupid mistake
:oops:
Please ignore this thread