I've been trying to figure out a simple script to open a data file from an ice hockey management game and made a change to one element of a struct for each record.
I have a struct named STAFF and I want to add 1000 to value of the StaffContractExpiresClub.year element of each record (the 'year' sub-element is part of the SI_DATE struct). I've been trying to use the stream to do this but just cannot to get it to work. Could anybody kindly give me a helping hand (I'm a novice to C/C++)?
I thought I might add; I've been able to achieve what I want to do (i.e. update a particular element/field within each record) without using struct. I have done this by counting the number of bytes into each record the value is located and the using seekg() and seekp() to navigate to that point.
However, what I would now like to do is achieve the same thing using struct (as detailed in my first post) because when I want to update several elements/fields within a record it starts getting messy using my non-struct method.