   copy constructing in a derived class
  Hello, simple question (I can't imagine I haven't read about this somewhere, yet I can't remember how to do it):how can I call the base copy constructor from a derived class?ex:class base {public:base(int _z) : z( _z) {};base(const base& _other) {z = _other.z + 100;std::cout << "copy constructor called - B" <<std::endl;}int z;};class derived : public base {public:derived(int z, int _w) : base(z), w(_w) {std::cout << "non default constructor - A" << std::endl;};derived(const derived& _other)  {w = _other.w;}int w;};And yet if I copy an element declared from the derived class it should also copy the "z" value.. ho can I achieve this?   
  Same way you did the first constructor, just use the initializer list and call base(_other) (which will in turn call base(const base& _other) which will do its magic).  The copy constructor is essentially just a constructor that happens to take an argument of the same type, so you can still use an initializer list and stuff.  And BTW, you don't need the ; after those braces.   