What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace std;class A {public:int x;A() { x=0;}A(int x) { this?>x=x;}};class B : private A {public:using A::x;B() { x=1;}B(int x) {this?>x = x;}};int main () {B c1;B c2(?5);cout << c1.x;cout << c2.x;return 0;}
A. It prints: 5
B. It prints: 1?5
C. It prints: 05
D. It prints: 0
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!