www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/07/02:24:45

From: Zibarev Denis <den AT re DOT tsu DOT tomsk DOT su>
Message-Id: <199703071421.OAA23429@re.tsu.tomsk.su>
Subject: Re: HELP - need help to resolve ......
To: djgpp AT delorie DOT com
Date: Fri, 7 Mar 1997 14:21:52 +0000 ()
MIME-Version: 1.0

> How can I declare two different classes, where each class has a member
> variable of the other class type. My problem is how to get the compiler to
> recognize a variable type before it has been created.

You must have a 'prototype' of the second class (the_owner), i.e. declare,
that this class exist. Put the string that declares the existance of the
second class before declaration the first class:

class the_owner;

>class the_cat
>	 {
>	 private:

This ought to solve your problem.

								HHTYAY,
				 Denis Y. Zibarev aka [The Necropolis],
					      FTP Archive Administrator
						  <den AT re DOT tsu DOT tomsk DOT su>

=== VISIT US: ftp://re.tsu.tomsk.su ====
---
* "...And he shall journey into the realm of the death, and contest with
   the forces therein, into the very gates of despair;	but  whether  he
   shall return to the world of light,no man knows..." <re.tsu.tomsk.su>

- Raw text -


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