Skip to content

Instantly share code, notes, and snippets.

@aabdelfattah
Created June 4, 2019 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aabdelfattah/6c71e3cf358d9c657bcfe2e90bb0e7ba to your computer and use it in GitHub Desktop.
Save aabdelfattah/6c71e3cf358d9c657bcfe2e90bb0e7ba to your computer and use it in GitHub Desktop.
copy constructor
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