What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
int x;
};
class B : public A {
public:
B() { x=1;}
B(int x) {this?>x = x;}
};
int main () {
B c1;
B c2(10);
cout << c1.x;
cout << c2.x;
return 0;
}
Keneth
11 months agoVenita
10 months agoWhitley
10 months agoMilly
10 months agoBettina
10 months agoJaclyn
10 months agoRoosevelt
10 months agoHyun
10 months agoRonald
11 months agoSelene
11 months agoJacquline
11 months agoMicaela
11 months agoMartina
10 months agoYuette
10 months agoYuette
10 months agoPeggie
10 months agoBilly
11 months agoKarrie
11 months ago