Home / MCQ Bank / Computer
Computer Inheritance In C Plus Plus Difficulty: Medium

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

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following C++ code? #include <iostream> using namespace std; template <typename T> void fun(const T&x) { static int count = 0; cout << "x = " << x << " count = " << count; ++count; return; } int main() { fun<int> (1); cout << endl; fun<int>(1); cout << endl; fun<double>(1.1); cout << endl; return 0; } Which is not the property of location object? What is the name given to the exchange of control signals which is necessary for establishing a connection between a modem and a computer at one end of a line and another modem and computer at the other end? What is operator overloading in C++? ask=T is a parameter that R asks before producing the . . . . . . . .