|
Question #55: What gets printed by this program?
72% on 1003 times asked
#include <iostream>
struct Shape
{
void print()
{
std::cout << "SHAPE" << std::endl;
}
};
struct Box : public Shape
{
void print()
{
std::cout << "BOX" << std::endl;
}
};
int main(int argc, char** argv)
{
Shape* s1 = new Box;
s1->print();
return 0;
}
|