No appropriate default constructor

N

NoNickName

Here's what I've got, essentially:

main()
{
class derClassA *dCA;
dCA = new(derClassA);
}

class derClassA
{
public:
derClassA(void);
....
}

derClassA::derClassA(void)
{
}
....

Try to compile, I get "No appropriate default constructor".

Any thoughts?

Thx.

LHC
 
J

John Harrison

NoNickName said:
Here's what I've got, essentially:

I would suggest posting what you have exactly. Somewhere in going from
what you have exactly to to what you have 'essentially' you have lost
the cause of your error.

Some errors below but I don't think any of these are the problem you are
complaining about.

int main()
{
class derClassA *dCA;

derClassA* dCA;
dCA = new(derClassA);

dCA = new derClassA;
}

class derClassA
{
public:
derClassA(void);
derClassA();


};


derClassA::derClassA()

{
}
...

Try to compile, I get "No appropriate default constructor".

Any thoughts?

Yes, post the real code.

john
 
N

NoNickName

I'll check out your suggestion(s) and if I still can't get it I'll post
the real stuff.

Thx, LHC
 
J

Jim Langston

NoNickName said:
I'll check out your suggestion(s) and if I still can't get it I'll post
the real stuff.

Thx, LHC

And if you actually declared your class after main, that could be a problem
also. Declare them before main so the compiler knows what they are before
they're used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top