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
11 months agoRoosevelt
11 months agoHyun
11 months agoRonald
11 months agoSelene
11 months agoJacquline
11 months agoMicaela
11 months agoMartina
11 months agoYuette
11 months agoYuette
11 months agoPeggie
11 months agoBilly
11 months agoKarrie
11 months ago