Default constructor in c++

In C++;
class CExample {
int a,b,c;
CExample (int n, int m) { a=n; b=m; };
void multiply () { c=a*b; };

For the above code what will happen if we declare object of the class as CExample c1?
What if we remove the constructor definition and then declare the object?


  1. ans1 compiler error ...bcoz u hav defined a now no defult constructor wud br provided....

    ans2 would work fine if u remove the defn...


Post a Comment

Popular posts from this blog