Mail Archives: djgpp/1999/03/07/22:50:20
This may be a simple lack of experience problem, but I can't see how my
data is being corrupted. Here's the situation:
void SaveSprite(pSprite TheSprite,int *FileName)
{
FILE *fp;
if((fp=fopen(FileName,"w"))==NULL)
{
blah..blah...
}
fclose(fp);
}
This alone changes some of the values in an array pointed to by a element
of the TheSprite structure. The structure is defined as:
typedef struct Sprite
{
int Height,Width;
unsigned int *Bitmap;
} Sprite, *pSprite;
After the call to SaveSprite, the data in Bitmap is corrupted. I malloced
and everything, and checked the data just before and just after the call,
and several bytes are changed. Any assistance you could offer would be
greatly appreciated.
-Mike Taylor
- Raw text -