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