C++ Programming Question:
Download Questions PDF

What is a default constructor in C++?

Answer:

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;
}

Download C++ Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How does throwing and catching exceptions differ from using setjmp and longjmp?What is a conversion constructor C++?