Article View: alt.comp.lang.learn.c-c++
Article #374Re: Class and pointer problem
From: Steve Horne
Date: Tue, 29 Jun 1999 00:00
Date: Tue, 29 Jun 1999 00:00
20 lines
1203 bytes
1203 bytes
Magnus Hult wrote:
>
> declare variables and so on, but apparently it does. Is my compiler too old,
> or is there a better way to solve the problem?
Yes, it's called "forward declaration". It works like this:
class Object; // this is the forward declaration
Object *ptr; // Pointers to declared but undefined things are OK.
class Object {
public:
// your definition
};
Hope this helps,
-Steve
Technical Details
Message-ID:
<37794056.6D1DC546@bridge.bst.bls.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<S3be3.496$nZ5.796@nntpserver.swip.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8d38,c03b176bbf53f537 X-Google-Attributes: gidf8d38,public X-Google-Thread: 109fba,c03b176bbf53f537 X-Google-Attributes: gid109fba,public X-Google-Thread: 114592,c03b176bbf53f537 X-Google-Attributes: gid114592,public From: Steve Horne <steve.horne1@bridge.bst.bls.com> Subject: Re: Class and pointer problem Date: 1999/06/29 Message-ID: <37794056.6D1DC546@bridge.bst.bls.com> X-Deja-AN: 495362113 Content-Transfer-Encoding: 7bit References: <S3be3.496$nZ5.796@nntpserver.swip.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Technology & Process Consulting, Inc. Mime-Version: 1.0 Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cpp.language,comp.lang.c++