Hello!
I'm trying to make simple bank database, witch is based of structure. I'm having problem with function for changing balance of specific account. Program should get positive or negative number and change balance by that number. The problem is that the new changed balance doesn't go in file, so changes doesn't save and later when I ask program to output data of client it shows the balance I had in beginning, not updated balance.
What should I change in the code for program to work the right way?
All help is appreciated.
PS: sorry for language errors, English is not my first language.
On line 23 you call seekg(), which moves the stream's read file pointer. You need to call seekp(), which moves the write file pointer. I'd also recommend moving it from std::ios::beg, rather than std::ios::cur.