What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public :
void print() {
cout << "A ";
}
};
class B {
public :
void print() {
cout << "B ";
}
};
int main() {
B sc[2];
B *bc = (B*)sc;
for (int i=0; i<2;i++)
(bc++)->print();
return 0;
}
Freida
7 months agoGlennis
7 months agoViva
7 months agoTatum
7 months agoCrista
7 months agoShenika
7 months agoPamela
7 months agoCrista
8 months agoShenika
8 months agoLuann
9 months agoGladys
9 months agoShawnna
9 months agoKatie
9 months agoVicky
9 months agoBelen
8 months agoLuther
8 months agoWayne
9 months ago