I'm trying to write a text based game using C. To do this the way I want, I need to include a save system that will output all of the necessary variable values to external files, then be able to load the values fro those files later. Any advice?
What kind of variables? Are we talking just scalar values or data structures? The former are easy to export, but the latter could take a little thinking to get a format that's easy to both export and subsequently import.
Let's step back a moment. How well do you know C? Granted I didn't provide details, but what I said should be enough to get you started unless you're a total beginner with no clue how to read and write files or about basic string manipulation.
I'd recommend writing the value of the variables to a text file, and tag each value with the name of the variable. That way you can change the program to add more or remove some variables without changing the format of the file. An old *.ini file format is good for that, for example
[Mary] // player name
[DonkeyKong] // another player name
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...