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
3 months agoGary
3 months agoColette
3 months agoCassi
4 months agoYvonne
4 months agoRory
4 months agoEric
4 months agoTyisha
4 months agoFrank
5 months agoBonita
5 months agoMargurite
5 months agoHuey
5 months agoWilliam
5 months agoSylvia
6 months agoAlease
11 months agoYoko
10 months agoTula
11 months agoVincenza
11 months agoClaudia
12 months agoYvonne
10 months agoKina
10 months agoBethanie
10 months agoCelestine
10 months agoAvery
12 months agoPearly
12 months agoCammy
12 months agoShayne
12 months agoDaryl
12 months agoMelina
12 months agoYvonne
11 months agoLaticia
11 months agoRicarda
11 months agoAmber
11 months agoWillodean
11 months agoBrynn
11 months ago