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;
}
Alease
4 months agoYoko
3 months agoTula
3 months agoVincenza
4 months agoClaudia
4 months agoYvonne
2 months agoKina
3 months agoBethanie
3 months agoCelestine
3 months agoAvery
4 months agoPearly
5 months agoCammy
5 months agoShayne
5 months agoDaryl
5 months agoMelina
5 months agoYvonne
4 months agoLaticia
4 months agoRicarda
4 months agoAmber
4 months agoWillodean
4 months agoBrynn
4 months ago