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