Bar: 'class' type redefinition compile time error

A

A

Hi,

I created an array of user defined objects dynamically in a class Foo's
constructor.

class Foo{

Foo(){
Bar* b = new Bar();
}

It gave me a "no default constructor for object Bar" so i added it like so:

class Bar{

Bar(){}; //added this one
Bar(double d1, double d2){...};
}

now i get a
Bar: 'class' type redefinition compile time error.



Any helps appreciated.

REgards

dsf
 
J

Josephine Schafer

A said:
Hi,

I created an array of user defined objects dynamically in a class Foo's
constructor.

class Foo{

Foo(){
Bar* b = new Bar();
}

It gave me a "no default constructor for object Bar" so i added it like so:

class Bar{

Bar(){}; //added this one

No semicolon here.
Bar(double d1, double d2){...};

Same here
;
Semicolon here.
now i get a
Bar: 'class' type redefinition compile time error.
HTH,
J.Schafer
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top