0
File Handling(Updated)
Hello everyone. I am given an assignment where a menudriven program using files is to be written. But the balance is not getting updated. Debug my code please? EDIT: I made a few corrections. Still can't get the right answer. https://code.sololearn.com/cNum6XDuF9hD/?ref=app
4 Answers
+ 1
May not solve the problem, but here are some points I noticed of the code
Line 20: use of %d specifier for reading bank.custid [signed long]. Use %ld instead.
Line 22: Use of deprecated function fgets() to read bank.name. Use fgets() instead.
Line 25: Use of deprecated function fgets() to read bank.dob. Use fgets() instead.
Line 28: Use of %lld [signed long long] specifier for bank.custid [signed long]. Use %ld instead.
Line 39: bank.bal is [float] but deposit is [int]. Declare deposit as [float]
Line 49: bank.bal is [float] but withdraw is [int]. Declare withdraw as [float]
Line 60: Use of function name (fwrite) in branch condition. Use return value from fprintf() call at line 28 to verify file write status instead.
Line 72: Use of %lld [signed long long] specifier for bank.custid type [signed long]. Use %ld instead.
+ 2
Thank me if your problem is solved, not before ... XD
+ 1
Whoa. Thanks man!
+ 1
Still man,you took the effort to look into my code.