So i have a interface class
class interfaceClass
{
public:
virtual void func1( void ) = 0;
virtual void func2( void ) = 0;
protected:
int m_interfaceVar;
}
and a class that inherits from it. Why can't i set the member variable of the interface class as follows.
class inhertitedClass : public interfaceClass
{
inheritedClass(int getInt): m_interfaceVar(getInt){};
~inheritedClass(){};
}
and i have to do it like this
class inhertitedClass : public interfaceClass
{
inheritedClass(int getInt){ m_interfaceVar = getInt;}
~inheritedClass(){};
}
I'm sorry if this is a dumb question, but i just ran in to it the other night while i was switching my abstract class into an interface class (the back to an abstract class).