From: cljones 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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