Bloomberg LP Interview Question
Software Engineer / DevelopersI think BabelFish was right. The following code won't compile in VS 2008.
class Base
{
public:
Base() {};
virtual ~Base() {};
virtual int foo() { cout << "base foo" << '\n'; };
};
class Derived : public Base
{
public:
Derived() {};
~Derived() {};
void foo() { cout << "derived foo" << '\n'; };
};
Should be: virtual int foo() { cout << "base foo" << '\n'; return 0; };
Nevertheless it won't compile.
this will not work. return type is included when comparing the signature. (at least with C++ it is
- NewStart April 02, 2010