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
8 months agoGlennis
8 months agoViva
8 months agoTatum
8 months agoCrista
8 months agoShenika
8 months agoPamela
8 months agoCrista
9 months agoShenika
9 months agoLuann
10 months agoGladys
10 months agoShawnna
10 months agoKatie
10 months agoVicky
10 months agoBelen
9 months agoLuther
9 months agoWayne
10 months ago