delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/03/00:00:36

From: cljones <cljones AT concentric DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP C++ semi-newbie class question can anyone help?
Date: 02 Aug 1998 23:53:22 EDT
Organization: Concentric Internet Services
Lines: 35
Message-ID: <35C53474.6F3A@concentric.net>
References: <35bf1d61 DOT 25001113 AT news DOT ihug DOT co DOT nz>
Reply-To: cljones AT nospam DOT concentric DOT net
NNTP-Posting-Host: ts002d15.col-co.concentric.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I didn't try this at home but doesn't loc[] (and all this other
stuff) default to private?  Before breaking down (graphics algorithms
are great for OO programming), try to public loc[] (although in
general it's best to protect your data), or access loc[] indirectly
though a get() type method.  

-Chester

zappaz AT ihug DOT co DOT uk wrote:
>...
> // and a plane class defined by three Point3d's :
> 
> class plane {
>...
>       class Point3d *loc[4];  //loc[0] unused
>...
> public:
>       void operator = (class plane *);
>...
> };
> 
> Now the following code using these classes gives me a floating point
> exception:
>...

You don't show the scope of the calling
mechanism, but it looks like loc[] really isn't defined there.


> double temp = (double) loc[1]->getX(); //this line causes an
> exception,
> printf("%f\n", loc[1]->getX()  ); // but this line is fine - ???
> 
>... 
> ChrisC
onflicting types for `_osminor'
c:/djgpp/include/stdlib.h:167: previous declaration of `_osminor'
In file included from allegro.h:56,
                         from src/allegro.c:36:
c:/djgpp/include/errno.h:58: conflicting types for `sys_errlist'
c:/djgpp/include/stdlib.h:161: previous declaration of `sys_errlist'
make.exe: *** [obj/djgpp/allegro.o] Error 1



- Raw text -


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