Re: foward declarations


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Dave Longley on April 16, 2001 at 00:12:20:

In Reply to: foward declarations posted by Mike Haggerty on April 15, 2001 at 23:36:31:

I include my "class2.h" in the class1 header file, but not vice versa--i don't think its necessary to include it at all for forward declaration reasons.

: ok...i got this part so far. if we have two classes that need to know about each other, we say:

: class1 header file:

: class class2;

: class class1 {
: class2* foo;
: };

: class2 header file:

: class class1;

: class2 {
: class1* foo2;
: };

: my question is about the #includes. do we #include "class2.h" in the class1 header file and vice versa? mine somehow doesnt work when i do this.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]