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

13th Oct 2020, 3:35 AM
Manav Grover
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.
13th Oct 2020, 5:57 AM
Ipang
+ 2
Thank me if your problem is solved, not before ... XD
13th Oct 2020, 6:22 AM
Ipang
+ 1
Whoa. Thanks man!
13th Oct 2020, 6:12 AM
Manav Grover
+ 1
Still man,you took the effort to look into my code.
13th Oct 2020, 6:24 AM
Manav Grover