View Single Post
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: help about fread and fwrite

 
0
  #2
Nov 23rd, 2008
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:
  1. 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:
  1. printf("\nFile saved\n");

Avoid using of non-standard function flushall().
Last edited by ArkM; Nov 23rd, 2008 at 10:45 am.
Reply With Quote