This is a topic is covered in a generalized way in another post that i found later: Operator overloading
But to be specific, here is a small snippet of code:
class wordchecklist
{
string name,type;
unsigned int stats;
};
What i want to do, is overload the output operator so that the following code works
Edit: (keep in mind it contains private members so i would prefer doing so by creating a member function of some sort):
ofstream data(database.txt,ios::app);
data<<wordchecklist;
data.close();
so that my database.txt file contains:
mywordchecklistname mywordchecklisttype mywordcheckliststats
Same goes for the input operator...