Explain function overloading, C/C++ Programming

Assignment Help:

Function Overloading

Function overloading is a form of polymorphism. Function overloading facilitates explaining one function having many forms. In other words it facilitates explaining several functions with the same name, thus overloading the function names. Like in operator overloading, even here, the compiler uses context to verify which definition of an overloaded function is to be invoked.

Function overloading is used to define a set of functions that essentially, do the similar thing, but use different argument lists. The argument list of the function is also call as the function's signature. You can overload the function only if their signatures are dissimilar. 

The differences can be

 1. In number of arguments,

 2. Data types of the arguments,

 3. Order of arguments, if the number and  data types of the arguments are similar.

e.g.

                                int add( int, int );

                                int add( int, int, int );

                                float add( float, float );

                                float add( int, float, int );

                                float add(int,int,float);  

 


Related Discussions:- Explain function overloading

Explain logical operators, Logical Operators We say any expression that...

Logical Operators We say any expression that evaluates to zero is a FALSE logic condition and that evaluating to non-zero value is a TRUE condition. Logical operators are usefu

What is default argument, Default argument: When the argument is missin...

Default argument: When the argument is missing then the function will read the default value of the missing argument.  To make use of default argument functionality the argu

Lowest cost entry, code for solving optimal solution for matrix

code for solving optimal solution for matrix

Roman code python help , In general, Roman numerals can be converted mathem...

In general, Roman numerals can be converted mathematically by simply assigning a numerical value to each letter, according to the chart below, and calculating a total: M=1000 | D=5

Want an ea project for jack bsher, Want an EA project for Jack Bsher Pro...

Want an EA project for Jack Bsher Project Description: New EA game Skills required   Android, C++ Programming, PHP, Metatrader, SQL

Decompression of files compressed with LZW, The files are meteorological ra...

The files are meteorological radar data whose decompression is badly needed for relative study. Please contact Kathy Lee (Email: ; Cell phone: 0086 15701799056) or Mr. Zhu (Email:

Define internal static storage class - computer programming, Define Interna...

Define Internal static storage class - computer programming? The Internal static variables are those that declared inside a function. The scope of the internal static variables

Matrix transposition cipher, write a C rpogram that can display the transpo...

write a C rpogram that can display the transpose form of a ciphertext matrix.Prompt users to provide row and coloumn number of matrix.Then user will input plaintext and the program

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd