So I want to save my game in a single .txt file, that way I don't have to search through a ton of different files to load the game.
My idea is to save a character's name in one line then write in the ints for the character's stats on the next then the floats, doubles, etc. in following lines then repeat the whole process for the next character. But I also want to save game progress and board info after all characters have been saved.
What I need is a way to detect if a piece of information in a file is an int, float, string, etc. without crashing the program.
Should I load the info into a string first then check if I can convert the string to an int/float, or is there a way to check what type of info is on the next line without loading it into a variable first?