Relative Content

Tag Archive for cdebugginghexdumpunistd.h

Write using unistd.h

I have this program that is basically a mini game played in the terminal where the player is in a dungeon and tries to kill a dragon. I have a function that tries to save the game when the player chooses too and i see that its not writing the correct input, thus causing the load of that saved file to crash with a segmentation fault. I used hexdump to see that indeed the input I want to save isn’t correct (I have a saved file that has been given to me with the correct contents for a specific game). The following is my save_game function and relevant structs to the game. Can someone help me identify the issue?