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