First page Back Continue Last page Graphics
Dynamic Binding example
- BrassPlus ophelia;
- Brass * bp;
- bp = &ophelia;
- bp->ViewAcct( ) // which version??
Not Virtual, it uses a pointer type (Brass *) and invokes Brass::ViewAcct( ).
The pointer is known at compile time, so the compiler can bind ViewAcct( ) to Brass:ViewAcct( ) AT COMPILE TIME!