0 votes
in C Plus Plus by

What is a Default Constructor?

1 Answer

0 votes
by
Default constructor is a constructor that either has no arguments or if there are any, then all of them are default arguments.

Example:

class B {

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

 };

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

{

 B b; return 0;

 }
...