Created
June 4, 2019 16:19
-
-
Save aabdelfattah/6c71e3cf358d9c657bcfe2e90bb0e7ba to your computer and use it in GitHub Desktop.
copy constructor
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
class Obj { | |
//default constructor | |
Obj(int size){ | |
.. | |
} | |
//copy constructor | |
Obj(const Obj& other){ | |
.. | |
} | |
//assignment operator | |
Obj& operator= (const Obj& other){ | |
.. | |
} | |
} | |
Obj B; | |
B = Obj(1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment