C++ Interview Questions and Answers

 

What is a default constructor in C++?

Default constructor WITH arguments





class B {



public:



B (int m = 0) : n (m) {}



int n;



};





int main(int argc, char *argv[])



{



B b;



return 0;



}

Posted by:Richards