What is the Difference between Overloaded Functions and Overridden Functions ?

October 28, 2007 · Filed Under C++ Questions, Placement Questions 



Don't want to miss a single bit? Subscribe By Email for Daily Jobs

Enter your email address :

All the latest from JobsAdda on Jobsadda.com delivered to your mailbox everyday.

In C++, overloading is simply the use of the same function identifier for different functions declared in the same scope.

E.g.
void display (int);
void display (string);

The above two functions are clearly overloaded. The compiler will distinguish among them by the actual argument used in the call to display.

Overriding can occur only in the presence of a base class virtual function. Overriding has nothing whatsoever to do with overloading. A nonvirtual base class function cannot be overridden, only hidden. In overriding the function prototype in the derived class has to be exactly the same as the one in the base class

Related Articles


Get Latest JobsAdda.com Jobs, news & updates  via Email