February 6th, 2013, 05:34 PM
Save files (reading and writing to files)
I'm studying programming right now, and we've just moved onto file input/output.
I understand perfectly how to open and close files, but I'm having trouble with writing to files.
Say I wanted to record to a file (lets call it savegame.txt) that the player is at position (x,y), has 'a' gold and 'b' amount of items, how would I do that ?
Thanks for your time.
February 6th, 2013, 05:42 PM
Use the fprintf() function.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo