0% found this document useful (0 votes)
215 views1 page

Binding and Message Passing

Static binding matches function calls to definitions at compile time using function overloading and operator overloading. Dynamic binding matches functions at runtime using virtual functions when a base class pointer points to a derived class object. Message passing allows objects to communicate by sending requests to invoke functions in receiving objects and pass along information.

Uploaded by

Ipsha Guha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
215 views1 page

Binding and Message Passing

Static binding matches function calls to definitions at compile time using function overloading and operator overloading. Dynamic binding matches functions at runtime using virtual functions when a base class pointer points to a derived class object. Message passing allows objects to communicate by sending requests to invoke functions in receiving objects and pass along information.

Uploaded by

Ipsha Guha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Static Binding :

By default, matching of function call with the correct function definition happens at compile time.
This is called static binding or early binding or compile-time binding. Static binding is achieved
using function overloading and operator overloading. Even though there are two or more functions
with same name, compiler uniquely identifies each function depending on the parameters passed to
those functions.

Dynamic Binding :
C++ provides facility to specify that the compiler should match function calls with the correct
definition at the run time; this is called dynamic binding or late binding or run-time binding.
Dynamic binding is achieved using virtual functions. Base class pointer points to derived class
object. And a function is declared virtual in base class, then the matching function is identified at
run-time using virtual table entry.

Message Passing: Objects communicate with one another by sending and receiving information to
each other. A message for an object is a request for execution of a procedure and therefore will
invoke a function in the receiving object that generates the desired results. Message passing
involves specifying the name of the object, the name of the function and the information to be sent.

You might also like