Dynamic binding in C ++

I need to clarify dynamic binding in C ++. I am confused as follows:

  • In C, you can have an array of function pointers and assign different functions to the same signature and call them based on the index; is it dynamic linking?

  • In C ++, you can have an array of pointers to a base class, but you can call different functions of a derived class by assigning the addresses of objects of a derived class to an array of a base class of pointers and using virtual functions, Is this a dynamic binding?

  • Which term is correct - Dynamic bindingor Link-Time Binding?

+5
source share
5 answers

The answers

  • . , . . .
  • . , . , .
  • , . .
+6

. ++ , , C.

( - , struct, . , , , . "" , .)

+2

- , , . , 1), 2) , 2).

( ) ( ). / , . / , - .

+1

C? ? C.

+1

You mix the concept of dynamic linking with an implementation. Dynamic binding, i.e. the choice of a method to call based on the type of the receiving object, can be implemented using some form of dynamic sending, i.e. Yours (1), but we usually define a name to refer only to the situation (2).

+1
source

All Articles