P
placid
Hi
if a have the following classes
class A
{
public:
A();
virtual ~A();
virtual string someFunction() const = 0;
}
class Bublic A
{}
int main(void)
{
A* aa = new B();
}
I get this compiler error
main.cpp: In function `int main(int, char**)':
main.cpp:10: error: cannot allocate an object of type `A'
main.cpp:10: error: because the following virtual functions are
abstract:
B.h:30: error: virtual std::string B::someFunction() const
does anyone know whats this abou, because if i remove the 'const' in
the Base class it works but i wont the Base class to be abstract !
Thanks in advance
if a have the following classes
class A
{
public:
A();
virtual ~A();
virtual string someFunction() const = 0;
}
class Bublic A
{}
int main(void)
{
A* aa = new B();
}
I get this compiler error
main.cpp: In function `int main(int, char**)':
main.cpp:10: error: cannot allocate an object of type `A'
main.cpp:10: error: because the following virtual functions are
abstract:
B.h:30: error: virtual std::string B::someFunction() const
does anyone know whats this abou, because if i remove the 'const' in
the Base class it works but i wont the Base class to be abstract !
Thanks in advance