Created
July 12, 2019 20:33
-
-
Save zhangxiaomu01/137be050da2e11f90df5910dfa55e1e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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