Interview Questions

What is a default constructor?

C++ Interview Questions and Answers


(Continued from previous question...)

What is a default constructor?

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

(Continued on next question...)

Other Interview Questions