Please tell difference between copy constructor

What is the difference between copy constructor and default copy constructor.

and

class dis{
int x,y;
public:
dis(): x(10) y(20)
{ }

// dis() : x(10) y(20) {} please explain the syntax of this constructor.
What is the difference between copy constructor and default copy constructor.
http://en.cppreference.com/w/cpp/language/copy_constructor


also:

http://en.cppreference.com/w/cpp/language/rule_of_three

Note at the bottom, one can explicitly delete or default the class special member functions, where required.


// dis() : x(10) y(20) {} please explain the syntax of this constructor.

This uses a member initialization list, which is introduced by the colon.

http://en.cppreference.com/w/cpp/language/initializer_list
Topic archived. No new replies allowed.