Mail Archives: djgpp/2000/04/29/04:29:03
HPMAN wrote:
>
> char TestBuff[32]="123456789012345678901234567890";
> FILE *output;
>
> int main(void) {
> if((output=fopen("file.tst","wb"))==NULL) {
> printf("Error Opening Output File, Exiting...\n");
> exit(0);
> } else {
> fwrite(&TestBuff,sizeof(char),32,output);
> fclose(output);
> }
> return(1);
> }
>
> Well, this sample works (hard to do fewer things ;p)
>
> The problem is I included this test pattern in my program causing problems,
> and it doesn't work (functions are enclosed between lots of other code of
> course, but remain 100% the same...
>
> I got a segmentation fault : fwrite doesn't report an error, the program
> crashes at the call...
Since the test program above works, it is not useful for helping you find the
problem.
I suggest to read section 12.2 of the DJGPP FAQ list, and use techniques
described there to debug your problem.
- Raw text -