Writing full classes in C++ using stack and heap memory with operator overloading and memory management.