Skip to content

Instantly share code, notes, and snippets.

@zhangxiaomu01
Created July 12, 2019 20:33
Show Gist options
  • Save zhangxiaomu01/137be050da2e11f90df5910dfa55e1e1 to your computer and use it in GitHub Desktop.
Save zhangxiaomu01/137be050da2e11f90df5910dfa55e1e1 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<string>
#include<memory>
using namespace std;
class Dog{
string m_name;
public:
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