Mail Archives: djgpp/1997/03/06/10:44:00
>> Put a prototype of the class(es) you will be referring to _before_ the
>> class declaration, to inform it that it is a class and will be described
>> later. In your example:
>>
>
>I am not sure if you can do this, because it would lead to a recursive
>calling of the class. Let's say in main you would declare
>main()
>{
>the_owner master;
>}
><snip>
>
>I am not sure. Correct me if I am wrong.
Sorry, but you are wrong, the code example shows you declaring an
instance of the owner class, a prototype
is done before the class is defined or instanciated, you will more often
than not have such prototypes in
header files so that other classes can use their type, and compile
modularly.
Rob Humphris
- Raw text -