I'm writing a little game, and to save the game data I would like to take the variables that I have in main and send them to a save game function in a class.
Currently to save a user I set the file name as the username, and then the contents are, string (password), int, int, int.... char[], char[].
Is it possible to send multiple variable types through a function, or is there a better way of solving this issue.
Make a class that maintains your game's state. Give it a method that saves the game's state to disk. (And a method that can load the saved state.) Use the class to maintain the state of the game while playing.