Posted by Dave Longley on April 22, 2001 at 16:28:22:
In Reply to: forward declaration??? posted by Heather on April 22, 2001 at 15:56:16:
You need to have two classes know about each other and possess data member instances of each other. Include one header file if needed, most likely in your ecosystem header, not both, that causes an error. To forward declare, just use this example:
FIRST HEADER FILE:
SECOND HEADER FILE:
: Can anyone tell me more about foward declaration?
: or where I can read about it??? I don't recall ever hearing about it....if I use forward declaration of class1 in class 2, then must I include the class1.h in class2.cpp or something? cuz I am getting errors...
: (daiing...the project's due today and mine's not even compiling!!!!!!!!!!!!)
: Thanx ya all
Post a Followup