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 {
public:
void set() {
y = 4; z = 2;
}
void Print() {
cout << y << z;
}
};
int main () {
B b;
b.set();
b.Print();
return 0;
}
Yvonne
2 months agoGary
2 months agoColette
2 months agoCassi
3 months agoYvonne
3 months agoRory
3 months agoEric
3 months agoTyisha
4 months agoFrank
4 months agoBonita
4 months agoMargurite
4 months agoHuey
4 months agoWilliam
5 months agoSylvia
5 months agoAlease
10 months agoYoko
10 months agoTula
10 months agoVincenza
11 months agoClaudia
11 months agoYvonne
9 months agoKina
9 months agoBethanie
9 months agoCelestine
9 months agoAvery
11 months agoPearly
11 months agoCammy
11 months agoShayne
11 months agoDaryl
11 months agoMelina
11 months agoYvonne
10 months agoLaticia
10 months agoRicarda
10 months agoAmber
10 months agoWillodean
10 months agoBrynn
11 months ago