delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/06/10:44:00

Message-ID: <c=GB%a=_%p=Indigo_Active_Vi%l=CRIANLARICH-970306153320Z-141@crianlarich.Indigo>
From: Robert Humphris <r DOT humphris AT indigo-avs DOT com>
To: "'djgpp'" <djgpp AT delorie DOT com>, "'Andrew Deren'" <aderen AT eecs DOT uic DOT edu>
Subject: RE: HELP - need help resolving conundrum with classes
Date: Thu, 6 Mar 1997 15:33:20 -0000
Encoding: 24 TEXT

>> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019