Re: [Dev-C++] indirect references problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Siva C. <siv...@ya...> - 2007-09-27 04:32:06
|
Hello,
Logically, you might want to include PoliceMan.h in
Police.h; In order to declare a Police pointer in
PoliceMan.h, you should be declaring the class Police
in the file PoliceMan.h.
Do something like this:
<code>
// Filename: PoliceMan.h
// Do not include Police.h
class Police;
class PoliceMan {
private:
Police* myPolice;
};
</code>
Hope this helps,
Siva Chandra
--- Laura Lozano <lau...@gm...> wrote:
> Hello,
>
> I would like to do a double reference, I mean, I
> have two classes Police and
> PoliceMan in two files: Police.h and PoliceMan.h ,
> the class Police have a
> vector of pointers of PoliceMan: vector<PoliceMan*>,
> so Police.h include
> PoliceMan.h, and I would like include Police.h into
> PoliceMan.h but I have
> errors; This is that I would like to do:
>
> //Police.h
> #include "PoliceMan.h"
> class Police{
> private:
> vector<PoliceMan*> policeMen;
>
> ......
>
> //PoliceMan.h
> #include "Police.h"
> class PoliceMan{
> private:
> Police* myPolice;
> ....
>
> Is there any way to do that? Thank you
> >
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2005.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/>
_______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE:
> http://www23.brinkster.com/noicys/devcpp/ub.htm
>
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
|