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;

 }

Related questions

0 votes
asked Jun 15, 2020 in C Plus Plus by Robindeniel
+1 vote
0 votes
asked Jan 9 in C Plus Plus by GeorgeBell
...