I have been reading a lot of tutorials on C++ class but they miss something that other tutorials include.
Can someone please show me how to write and use a very simp
class A
{
public:
// a simple constructor, anyone can see this
A() {}
protected:
// a simple destructor. This class can only be deleted by objects that are derived from this class
// probably also you will be unable to allocate an instance of this on the stack
// the destructor is virtual, so this class is OK to be used as a base class
virtual ~A() {}
private:
// a function that cannot be seen by anything outside this class
void foo() {}
};