Date: Mon, 8 Mar 1999 10:57:29 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Roy Taylor cc: djgpp AT delorie DOT com Subject: Re: Problem with fopen In-Reply-To: <19990308035010932.AAA222.187@mike-s-toy> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 7 Mar 1999, Roy Taylor wrote: > void SaveSprite(pSprite TheSprite,int *FileName) > { > FILE *fp; > if((fp=fopen(FileName,"w"))==NULL) A file name is an array of characters, so you need to use "char *FileName" instead of "int *FileName". > This alone changes some of the values in an array pointed to by a element > of the TheSprite structure. Passing incorrect arguments to functions cause the program to overwrite other data. To find such problems, step through the offending code with a debugger and see which line causes the corruption.