Edit: I didn't explain myself properly. Try again.
I am writing a save game editor. The editor loads in the save game, checks the version. The version information was held in various "Data" statements, once the version was checked the correct offsets were loaded. The offsets were then assigned to variables. Below is an example of offsets for two versions of the game (Sensible World of Soccer):
Swos_Beta_09 = { # _update: 95/96
'num_players_pos': 56717, # - Number of players in the team
'team_name_pos': 55429, # - Team Name
'mgr_forename_pos': 54987, # - Managers forename
'mgr_surname_pos': 54996, # - Managers Surname
'mgr_fullname_pos': 55460, # - Managers Full Name (Yes it is stored twice!!)
'plr1_Position_pos': 55500, # - Position of the first player in the file. This is then 38 bytes of data
'money_pos': 54742, # - Money
'tact_pos': 88374, # - First Tactic
'first_team': 90635, # - First team in the file
'CJOffset': 90614, # - File position of the version number
'CJ': "CJ281112", # - This is the version we are expecting
'version_pos': "Sensible World of Soccer v0.09 - 28/11/1994 11.00am" # - And this is the version
Swos_Release_v10 = # _update: 95/96
'num_players_pos': 56719, # - Number of players in the team
'team_name_pos': 55431, # - Team Name
'mgr_forename_pos': 54989, # - Managers forename
'mgr_surname_pos': 54998, # - Managers Surname
'mgr_fullname_pos': 55462, # - Managers Full Name (Yes it is stored twice!!)
In python I used dictionaries, and then once checked the version (CJ031223 for example) it copied the correct offsets into another dictionary (or list) allowing me to access the data.
note: I will be using classes for the teams, and the players, I am not concerned with that here. I am looking for the best way to do this in c++ please.