Equiv of function prototype for classes?
Posted on 2003-10-30
I got myself into a chicken and egg scenario.
With functions you can do the following:
cout << "Hello World";
But with classes what do you do?
I have two classes, A, and B. B inherits from A. A creates an instance of B in one of it's member functions.
Obviously A has no idea that B even exists and If I were to move B above A in the source file then B will complain that A doesn't exist!
What do I do? Is it possible to create an object of B inside of A? I would think it is because you could create an A object inside of A.