ExamVeda
Login
Home
Inheritance in C plus plus
?

What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class A
{
	float d;
   public:
	A(){
		cout<<"Constructor of class A\n";
	}
};
 
class B: public A
{
	int a = 15;
    public:
	B(){
		cout<<"Constructor of class B\n";
	}
};
 
int main(int argc, char const *argv[])
{
	B b;
	return 0;
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.