What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
int x;
protected:
int y;
public:
int z;
A() { x=1; y=2; z=3; }
};
class B : public A {
string z;
public:
void set() {
y = 4;
z = "John";
}
void Print() {
cout << y << z;
}
};
int main () {
B b;
b.set();
b.Print();
return 0;
}
Isaac
3 months agoHildegarde
2 months agoMartina
2 months agoNovella
2 months agoElise
3 months agoRamonita
2 months agoSerina
2 months agoRyan
3 months agoPrincess
4 months agoYun
3 months agoNorah
3 months agoThaddeus
3 months agoIndia
4 months agoWei
2 months agoJean
2 months agoJanna
3 months agoLizette
4 months agoEleni
4 months agoReynalda
4 months agoEleni
4 months ago