2.1 What is it?

A shallow copy constructor is, by default, included with every class. You can consider a shallow copy constructor as defined as follows:

 
1class X 
2{ 
3  // defns 
4  public
5    X(const X &p1); 
6}
7 
8X::X(const X &p1) 
9{ 
10  memcpy(this, &p1, sizeof(*this)); 
11}

In other words, a shallow copy constructor just copies, byte-by-byte, from the parameter to the object being constructed.