Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using namespace std;
class Dog{
string m_name;
Dog(string name){cout << "Dog is created: "<< name <<endl; m_name = name;}
Dog(){cout << "Nameless dog created. " << name <<endl; m_nam = "nameless";}
~Dog(){cout << "Dog is destroyed: " << m_name <<endl;}
void bark(){cout << "Dog " << m_name << "rules!" << endl;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment