At Sunday 2004-11-07 00:09, you wrote:


>I modified the files and added #ifndef to every header file but unless
>I also add the #define statment I continue to get the redifinition errors.
>
>Do you have any suggestions of how to fix this since I am not allowed
>to use the #define statement. You pointed out that the class design is
>not proper...do you have any suggestions to how I can fix that?

does your compiler support   #pragma once

Yet another screwup the committee hasn't fixed in these DECADES


>Thank you
>
>
>--- In [EMAIL PROTECTED], shubhashish rudra <[EMAIL PROTECTED]>
>wrote:
> > Well well...you need to do some proper designing of
> > classes before implementation.anyway,now that you have
> > goofed that up.as we normally do use #ifndef construct
> > and use forward declarations to get rid of these.
> > cheers!!!
> > shubhashish
> > --- aeroman10 <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > Well, whenver I remove the #define CLASS_H statment
> > > I get the class
> > > type redifinition error.
> > >
> > > Although its weird that I can remove the #define
> > > statement from hw6e.h
> > > and hw6d.h files and the program works fine. But
> > > once define is
> > > removed from the other header files you get errors.
> > >
> > > Is there any way to fix that?
> > >
> > > --- In [EMAIL PROTECTED], "Victor A. Wagner
> > > Jr." <[EMAIL PROTECTED]> wrote:
> > > > At Saturday 2004-11-06 23:04, you wrote:
> > > >
> > > >
> > > > >I forgot to mention one important thing. Due to
> > > the crazy assignment
> > > > >instructions I am not allowed to use any #define
> > > statements even when
> > > > >you want to use it within a class definition.
> > > >
> > > > good!   #define obeys no scope
> > > >
> > > >
> > > > >--- In [EMAIL PROTECTED], "aeroman10"
> > > <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > Hi
> > > > > >
> > > > > > I am working on an assignment that deals with
> > > classes and
> > > inheritance
> > > > > > and I am stuck on error 'class' type
> > > redefinition.
> > > > > >
> > > > > > I have 5 classes. First class is base class.
> > > The next two
> > > classes are
> > > > > > derived from the first class. The next two
> > > classes are derived from
> > > > > > previous two classes (has to be like this due
> > > to the
> > > instructions). On
> > > > > > the main file, I have the following
> > > definitions...
> > > > > >
> > > > > > #include "hw6a.h"
> > > > > > #include "hw6b.h"
> > > > > > #include "hw6c.h"
> > > > > > #include "hw6d.h"
> > > > > > #include "hw6e.h"
> > > > > >
> > > > > > I got error "'class' type redefinition". If I
> > > commented all those
> > > > > > #include except the last one, then class in
> > > those class file doesnt
> > > > > > recognize when I initialize an object.
> > > > > >
> > > > > > Here are the program files.
> > > > > >
> > > > > > Main file:
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6.cpp
> > > > > >
> > > > > > Base class:
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6a.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6a.h
> > > > > >
> > > > > > Other derived class:
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6a.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6a.h
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6b.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6b.h
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6c.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6c.h
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6d.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6d.h
> > > > > >
> > > http://users3.ev1.net/~sonle/school/cpp/hw6e.cpp
> > > > > > http://users3.ev1.net/~sonle/school/cpp/hw6e.h
> > > > > >
> > > > > > Can someone please look at this and tell me
> > > how I can get this
> > > program
> > > > > > to work. I have been looking (and following)
> > > numerous examples and
> > > > > > really thought that this should work.
> > > > > >
> > > > > > Thank you in advance
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >To unsubscribe, send a blank message to
> > > > ><mailto:[EMAIL PROTECTED]>.
> > > > >Yahoo! Groups Links
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > Victor A. Wagner Jr.      http://rudbek.com
> > > > The five most dangerous words in the English
> > > language:
> > > >                "There oughta be a law"
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Check out the new Yahoo! Front Page.
> > www.yahoo.com
>
>
>
>
>
>
>To unsubscribe, send a blank message to
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>
>

Victor A. Wagner Jr.      http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"



To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=:HM/A=2376776/rand=403512744


Yahoo! Groups Links

Reply via email to