Login
Remember
Register
Ask a Question
What is a Default Constructor?
0
votes
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
What is a Default Constructor?
#default-constructor
#constructor-default
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jun 16, 2020
by
SakshiSharma
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;
}
...