Mail Archives: djgpp/1999/03/08/04:00:41
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.
- Raw text -