Question: Do we have to explicitly define a default constructor when we define a copy constructor for a class?? Please give reasons.

eg: 

```
class A 
{
    int i;

    public:
           A(A& a)
           {
               i = a.i; //Ok this is corrected....
           }

           A() { } //Is this required if we write the above copy constructor??
};      

```

Also, if we define any other parameterized constructor for a class other than the copy constructor, do we also have to define the default constructor?? Consider the above code without the copy constructor and replace it with 

```
A(int z)
{
    z.i = 10;
}

```

Alrite....After seeing the answers I wrote the following program.

```
#include <iostream>

using namespace std;

class X
{
    int i;

    public:
            //X();
            X(int ii);
            void print();
};

//X::X() { }

X::X(int ii)
{
    i = ii;
}

void X::print()
{
    cout<<"i = "<<i<<endl;
}

int main(void)
{
    X x(10);
  //X x1;
    x.print();
  //x1.print();
}

```

ANd this program seems to be working fine without the default constructor. Please explain why is this the case?? I am really confused with the concept.....

Answer: 
As AndreyT said, if you explicitly declare any constructor, including a copy constructor, the compiler will not implicitly declare or define a default constructor.

This is not always a problem.

If you do not want your class to be default-constructible, then it's perfectly fine not to declare a default constructor. But if you want it to be default-constructible (for instance, if you want to uncomment the `X x1;` line in your example), then you must declare and define a default constructor.

Also note that a default constructor is any constructor that can be called with no arguments, not just one with no arguments. `X::X(int = 5)` is a perfectly fine default constructor.
1) Constructor with no argument is called 'default Constructor'.
2) If user have not provided any of the following constructor, then the compiler declares
 the default constructor for you. 

```
  2a) Copy Constructor
  2b) Non-default constructor
  2C) default constructor. 

```

3) If compilers declares the 'default constructor', then it is said to be 'implicitly declared default constructor', 

4) The 'implicitly declared default constructor' are of two types 

```
   4a) **trivial** Constructor
   4b) **non-trivial** Constructor. 

```

5) Implictly declared default constructor is said to be 'trivial', when there is 
 5a) No reference variable 
 5b) No Virtual Function
 5c) No Virtual Base Class.
 5d) Parent class has 'trivial' constructor, 

```
Else, it is said to be 'non-trivial'.

```

Hope this helps.