Guys

Lets keep discussions in t his group limited to Algos and problems
neutral to any language.
@akshay: Request you to post these C++ language specific questions to
those language specific groups. This will not only help this group
remain confined to its core purpose but will help you get better
insights to ur problem by language specific geeks there. For C++ I
would recommend you to try the group
http://groups.google.co.in/group/comp.lang.c++.moderated/topics?hl=en.

Regards,
Sourav

On Jun 13, 5:08 pm, BALARUKESH SIVARAMAN <sbalarukesh1...@gmail.com>
wrote:
> In the first post the problem was that m_speed is not public also u should
> access m_speed using Scope resolution operator as m_speed is not a member of
> B.
> class A
> {
> public:
> virtual int speed()=0;
> int m_speed;};
>
> class B:public A
> {
> public:
> int speed()
> {
> return A::m_speed;}
> };
>
> For ur second question...
>
> int main()
> {
> A *aptr=new B;
> cout<<aptr->speed();
> return 0;
>
> }
>
> I hope ur not clear with the concept of virtual functions... This example
> will help you. If not post back ur questions...

-- 
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.

Reply via email to