Machine-translated by Google. Questions are authored in English.
Top

Discussion

By default, C++ language provides .................... .

  • A.early binding for variables and late binding for functions
  • B.late binding for variables and early binding for functions
  • C.early binding for variables and early binding for functions
  • D.late binding for variables and late binding for functions

Answer: C

By default C++ provides early binding for variables and early binding for functions.

Variables are bound to their types and storage at compile time. Function calls, including calls to member functions, are also resolved at compile time unless the function is declared virtual; only then does C++ use late (dynamic) binding through the virtual table.

So late binding is something the programmer asks for with virtual, not the default. Every option with late binding for functions or variables describes non-default behaviour.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.