Fstream + Enum's
Posted: Sun Aug 15, 2010 4:07 pm
Can you read in a word from a file with Fstream, but instead of it being read as a string, it's read as the number of an enumeration(if that made any sense).
and somewhere in the file
Code: Select all
//somewhere in main.cpp
enum Colors
{
red, blue, green
};
Colors myColor;
char[20] skip;
void read_file()
{
myFile << skip;
myFile << myColor;
}
Code: Select all
Color: red