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;
};
class B : public A {
string name;
public:
void set() {
y = 2;
z = 3;
}
void Print() { cout << y << z; }
};
int main () {
B b;
b.set();
b.Print();
return 0;
}
Leslee
4 months agoElli
2 months agoCarissa
2 months agoTherese
3 months agoVi
4 months agoAshley
4 months agoElvera
3 months agoCristina
3 months agoHaley
3 months agoLaura
3 months agoTruman
3 months agoTamra
3 months agoJerry
4 months agoStephen
4 months agoBernadine
4 months agoAdria
4 months agoAlesia
4 months ago