2. At the end of this tutorial you will be able to
• Explain function signature.
• Differentiate functions on the basis of their signature.
• Explain function overloading.
• Identify overloaded functions from a given c++ program.
• Identify which function will execute on a call to overloaded function.
• Identify an ambiguous function call.
• Write overloaded functions in a c++ program.
www.learnbywatch.com | yogendra@learnbywatch.com
3. Function Overloading / Function Polymorphism
• Polymorphism (बहुरूपता) means having many forms.
• Function polymorphism: A function in many forms.
• The process of creating same named functions is called function overloading.
• Such functions are called overloaded functions.
• In C++ two functions can have same name as long as their signatures are
different.
www.learnbywatch.com | yogendra@learnbywatch.com
4. Function Signature / Argument List
• Argument list of a function defines it’s signature.
• Signature of a function is different if any one of the following is different.
• Number of arguments,
• Data Type of arguments and
• Order of arguments.
www.learnbywatch.com | yogendra@learnbywatch.com
void setTime( ); void setTime(int hh); void setTime(int hh, double mm);
void setTime(double hh); void setTime(double mm, int hh);