Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[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,254
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
 

aProgrammer

Full Member level 2
Joined
Mar 29, 2001
Messages
149
Helped
23
Reputation
44
Reaction score
13
Trophy points
1,298
Location
Syldavia
Activity points
609
"class D_flipflop(){"

is not correct,

"class D_flipflop {"

is correct
 
  • Like
Reactions: mahaju

    mahaju

    points: 2
    Helpful Answer Positive Rating

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,254
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top