471,585 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,585 software developers and data experts.

Bar: 'class' type redefinition compile time error

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

Jul 19 '05 #1
1 4107

"A" <A@iprimus.com.au> wrote in message news:3f********@news.iprimus.com.au...
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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Nitin Bhardwaj | last post: by
1 post views Thread by squallions | last post: by
7 posts views Thread by A_StClaire_ | last post: by
1 post views Thread by Alex | last post: by
1 post views Thread by Martin.C.Johnsson | last post: by
reply views Thread by =?Utf-8?B?Sm9obkE=?= | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.