From: "Roy Taylor" To: Subject: Problem with fopen Date: Sun, 7 Mar 1999 21:50:33 -0600 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <19990308035010932.AAA222.187@mike-s-toy> Reply-To: djgpp AT delorie DOT com 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