Re: question with classes
Quote:
Originally posted by frenchfry164
I want CForce to be a friend class of CUnit, which would require CForce to be defined b4 CUnit so the compiler would know what class I'm talking about, but CForce must be defined after CUnit because the nodes are of course, CUnit's.
The class doesn't have to be defined prior, it just has to be declared prior -- much like a function declaration.
Before you try and make the class a friend just write:
class CForce; // Notice no brackets -- this is a declaration for the class, you define the class later just as you normally would.