Mail Archives: djgpp/1998/03/29/15:02:18
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 -