Re: C++ in embedded systems

From: Jimen Ching (jching_at_flex.com)
Date: 08/30/03

  • Next message: David Turvene: "Re: Xscale PXA255 versus PXA250"
    Date: Sat, 30 Aug 2003 07:46:19 -0000
    
    

    In comp.arch.embedded George Neuner <gneuner2@comcast.net> wrote:
    >class A;
    >class B : public A;
    >void F( A &a );
    >void F( B &b);
    >void G( B &b );
    > :
    >A *pA = new B;
    >F( *pA ); // calls F(A) not F(B)
    >G( *pA ); // error ... argument is not a reference to B
    > :

    This is one of those misconceptions I was talking about. This is not
    OOP at all. This is just function overloading. Which has nothing to
    do with OOP. What you really want to do is use polymorphism.

    --jc

    -- 
    Jimen Ching (WH6BRR)      jching@flex.com     wh6brr@uhm.ampr.org
    

  • Next message: David Turvene: "Re: Xscale PXA255 versus PXA250"