Is it so hard job to correct obvious errors: you get compiler messages on wrong function arguments: fread and fwrite want POINTERS to target/source data areas (&d - not d, &b - not b))!
Use code tag properly:
[code=c]
source
[/code]
Never use dangerous gets function: it does not check target buffer size. Use fgets instead of gets:
fgets(fn,sizeof fn,sdtin);
With gets you program crashed if the file name length is greater than 49.
Don't forget to append carriage return:
printf("\nFile saved\n");
Avoid using of non-standard function flushall().
Last edited by ArkM; Nov 23rd, 2008 at 10:45 am.