Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is a Default Constructor?
Home
C Plus Plus
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;
}
Related questions
0
votes
Q: What’s the use of default constructor?
asked
Oct 16, 2020
in
JAVA
by
SakshiSharma
#default-constructor
Java-questions-answers
0
votes
Q: What is use of the default constructor to create a Fragment in Android?
asked
Jun 23, 2020
in
JQuery
by
AdilsonLima
#android
0
votes
Q: What is the difference between a Copy Constructor and an Overloaded Assignment Operator?
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
#c-copy-constructor
#c-overloaded-assignment-operator
#assignment-operator
#copy-constructor
0
votes
Q: What is a Conversion Constructor?
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
#conversion-constructor
#constructor-conversion
0
votes
Q: What is a COPY CONSTRUCTOR and when is it called?
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
#copy-constructor
#constructor-copy-c
0
votes
Q: What is a Constructor and how is it called?
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
#c-constructor
#constructor-c
0
votes
Q: What is an Explicit Constructor?
asked
Jun 15, 2020
in
C Plus Plus
by
Robindeniel
#explicit-constructor
#constructor-explicit
+1
vote
Q: Can we make copy constructor private?
asked
Jul 16, 2019
in
C Plus Plus
by
Indian
#c
#stl
#oops
+1
vote
Q: What is Copy Constructor?
asked
Jul 16, 2019
in
C Plus Plus
by
Indian
#c
#stl
#oops
0
votes
Q: Is a default case necessary in a switch statement?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
...