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