delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/29/15:02:18

From: Charles Terry <cterry AT plinet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why does this crash?????
Date: Sat, 28 Mar 1998 11:38:35 -0800
Organization: All USENET -- http://www.Supernews.com
Lines: 55
Message-ID: <351D4ABD.6039@plinet.com>
References: <351c58e7 DOT 313662 AT news DOT ziplink DOT net>
NNTP-Posting-Host: 2769 AT 207 DOT 174 DOT 3 DOT 175
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jeff W./DMT wrote:
> 
> I have the following class declared:
> 
> class WorldClass
> {
>  TileType Tile[WORLD_HEIGHT+1][WORLD_WIDTH+1];
>  ObjType  Obj[WORLD_HEIGHT+1][WORLD_WIDTH+1];
> 
>  public:
>   int  Load(void); //reads in all map data
>   void Blit(BITMAP *buffer, DATAFILE *data); //blits world map to
> buffer
> 
> };
> 
> and hye following types:
> 
> typedef struct TileType
> {
>  int flag;
>  int tileno;
> };
> 
> typedef struct ObjType
> {
>  int flag;
>  int tileno;
>  int active;
> };
> 
> WORLD_HEIGHT is set at 14, WORLD_WIDTH is set at 19.
> 
> I have declared a variable, "World" of type WorldClass.  No matter
> where I put the following line of code:
> 
> World.Load();
> 
> my program crashes on me.  I tried setting a breakpoint there, and as
> soon as I hit F7 to trace into it, it crashes for no apparent reason.
> I'm not passing any variables, just calling a function.  Can anyone
> help me with this??  Thanks a bunch.
>  --Jeff W.
> 
I would guess suspect that somewhere in your program you
are overwriting that function.  My approach to check would
be to step start the program and thru the watch window get the
address of WorldClass::Load, then cast the address to a char pointer
in the watch window and see if the data is changed at any point
during execution.
good luck

Charles


- Raw text -


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