sourceforge.net/p/gucci <-- That's one of the projects that I own, and it uses two classes, one as an actual class, and the other as an abstraction to that class.
EDIT:
It occurs to me that it may be taken as slightly rude for me to just outright say 'No' to posting simple solutions.
It's meant to be.
I literally handed you a very thorough example of using classes and class abstraction, along with dynamic memory allocation and file streaming, including virtual functions, func consts, passing arrays by pointer, passing values by const ref, and static methods of classes, plus I included examples of pointer use, vectors, switches, loops, and the concept of separating each individual idea into it's own function.
You came back and told me that that wasn't good enough, you not only want a good example handed to you on a silver platter, but you also want it in exactly the way that you demand. If you don't want to look at my example, then I'm not going to help you further.
class TEST{
public: /* public function and variables are accessible outide object */
TEST(); /* constructor, is called when object is created */
~TEST(); /* destructor, is called when object is destroyed */
void print();
private: /* private functions and variables are not accessible outside object */
int a;
};
TEST::TEST()
{
a =5; //set private variable a
cout << "constructor" << endl;
}
TEST::~TEST()
{
cout << "destructor" << endl;
}
void TEST::print()
{
cout << "print function " << a << endl;
}
int mian()
{
TEST *test; //creates an empty pointer
test = new TEST; //create the object -> prints "constructor"
test->print(); //prints "print function 5"
//cout << test->a << endl; /* This is not allowed because a is private */
delete test; //free the memory -> prints "destructor"
return 0;
}