home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!spool.mu.edu!agate!ames!sgi!fido!odin!roadrunner.denver.sgi.com!bruceb
- From: bruceb@roadrunner.denver.sgi.com (Bruce Bailey)
- Subject: Re: class forward ref. in C++
- Message-ID: <1992Dec31.211446.20632@odin.corp.sgi.com>
- Sender: news@odin.corp.sgi.com (Net News)
- Nntp-Posting-Host: roadrunner.denver.sgi.com
- Organization: Silicon Graphics, Inc.
- References: <1992Dec31.201340.13142@twisto.eng.hou.compaq.com>
- Date: Thu, 31 Dec 1992 21:14:46 GMT
- Lines: 41
-
- In article <1992Dec31.201340.13142@twisto.eng.hou.compaq.com>,
- giangd@gocart.eng.hou.compaq.com (Giang Dao) writes:
- |> Dear C++ gurus,
- |> I have the following question :
- |>
- |> class A
- |> {
- |> ...
- |> B * bptr;
- |> ...
- |> }
- |>
- |> class B
- |> {
- |> ...
- |> A * aptr;
- |> ...
- |> }
- |>
-
- Can't you just do a forward declaration of B?
-
- e.g.,
-
- class B;
-
- class A
- {
- ...
- B * bptr;
- ...
- }
-
- class B
- {
- ...
- A * aptr;
- ...
- }
-
- Bruce Bailey (bruceb@denver.sgi.com)
-