EDIT: Saving issue semi-solved. See my later posts for more ineptitudness...
I have been trying to come up with a good solution on how to save an array of CHAR_INFO types to a file so I can read them back in at a later time. Looking at the code for CHAR_INFO kind of throws me off.
typedef struct _CHAR_INFO {
union {
WCHAR UnicodeChar;
CHAR AsciiChar;
} Char;
WORD Attributes;
} CHAR_INFO,
*PCHAR_INFO;
Looking at that it seems like it stores either a WCHAR or a CHAR and a WORD. So what I would need to do is find some way to write all that to a file in a manner that would be easy to read it all back in.
Would it be best to just dump each item into the file in order? For example:
saveFile << infoChar[currentLoop].AsciiChar
<< infoChar[currentLoop].Attributes << "\n"; // newline is stop point for the current index
And then read them back in a similer fasion? I don't need to write the 'WCHAR' for my program since I will be dealing only with ascii. Any ideas?
The reason
why I am doing this is because I have made a little program to let me draw ascii art. I want to be able to save the drawing so I can then load it back into the game I am working on.
[Edited by - -JetSirus- on July 27, 2006 8:50:22 PM]