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;
}
Eugene
5 months agoProvidencia
4 months agoProvidencia
5 months agoLeah
6 months agoGerald
5 months agoGwenn
5 months agoHorace
5 months agoIluminada
5 months agoElenor
5 months agoIlene
6 months agoVanesa
6 months agoFrancine
6 months agoRaina
5 months agoEarleen
5 months agoFrancine
6 months agoSerina
6 months ago