M-speed is private and you cannot call it from outside myPlugin. (though i did not understand what u wanted to say) Can you write ur prob explicitly? -------------------------------------------------- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14
On Sun, Jun 13, 2010 at 12:20 PM, akshay khatri <akshaykhatri...@gmail.com>wrote: > I have the following code structure > in my file myPlugin.h , i have defined this > > virtual int speed(); > > and gave a dummy implementation in myPlugin.cpp > > In another file otherPlugin.h I have included this line: > > #include <myPlugin.h> > private: > int m_speed; > > also class otherPlugin inherits myPlugin (public scope) > I want to redefine speed in otherPlugin.cpp > How should I return a value fromspeed() in it ? > > int myPlugin::speed() > { > return m_speed; > } > or > int otherPlugin::speed() > { > return m_speed; > } > > or anything else ? > > The error I get is that: m_speed was not declared in this scope. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.