delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/20/07:31:22

From: SEE DOT REPLY-TO AT f615 DOT n109 DOT z1 DOT fidonet DOT org (SEE.REPLY-TO)
Date: Fri, 19 Nov 1993 22:28:36 -0500
Subject: Local Pointer to Class
To: djgpp AT sun DOT soe DOT clarkson DOT edu

Reply-to: Bruce DOT Feist AT p0 DOT f615 DOT n109 DOT z1 DOT fidonet DOT org (Bruce Feist)
Fido-To: all

I'm having problems compiling the following with DJGPP 1.10.  layer[layerCtr] is
a pointer to a Layer.

for (int layerCtr = 0; layerCtr <= nLayers; layerCtr++) {
   Layer * theLayer (layer [layerCtr]);

   assert (& (theLayer -> network) == this);

In the above, I get a "base operand of '->' is not a pointer" error on the
'assert' line.  I have similar problems when I modify the code to turn theLayer
into a reference to Layer instead.

I haven't tried this version under Borland C++, but the reference version worked
fine there.

Any suggestions?

Bruce



- Raw text -


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