C++ Programming Question: Download Questions PDF
What is a default constructor in C++?
![C++ Programming Interview Answer C++ Programming Interview Question](https://globalguideline.com/public/images/interview/24.png)
Answer:
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;
}
class B {
public:
B (int m = 0) : n (m) {}
int n;
};
int main(int argc, char *argv[])
{
B b;
return 0;
}
Download C++ Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
How does throwing and catching exceptions differ from using setjmp and longjmp? | What is a conversion constructor C++? |