[SOLVED] C++ program does not compile

Status
Not open for further replies.

mahaju

Full Member level 2
Joined
Mar 17, 2007
Messages
125
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Activity points
2,252
Hi can anyone please tell me what is the mistake here?

Code:
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:
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
 

"class D_flipflop(){"

is not correct,

"class D_flipflop {"

is correct
 
Reactions: mahaju

    mahaju

    Points: 2
    Helpful Answer Positive Rating
Oh really sorry it was a stupid mistake
I just didn't look properly
Thank you for your help
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…