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

Program that computes square matrix multiplication, Goal: Design a progr...

Goal: Design a program that computes square matrix multiplication on GPU using CUDA. Write the code in C. In particular, your implementation should obey the following requiremen

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Assignment, Hi, Can i get a quote for my Programming assignment

Hi, Can i get a quote for my Programming assignment

Need ftp upload and mysql, Need FTP Upload and MySQL Project Description...

Need FTP Upload and MySQL Project Description: We are in need of an executable application that will be execute as a scheduled task on Windows Server 2008 R2 and can perform

C programming language, write an algorithm that reads a postive integer n a...

write an algorithm that reads a postive integer n and then finds and prints the sum of all integers between 1 and n (inclusive) that are disvisible by 7. please write this using c

Write a program to design a leet speak translator, The program will consist...

The program will consist of two text fields, two buttons, and a counter label.  One text field will be input, where the user types the plain text.  The second text field will be ou

Compiler Design - Limit In The Method Instructions, Raj is a newbie to the ...

Raj is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with ''}''

Friendly function and rules of friend function, F r i e n dly Function...

F r i e n dly Function: A class can have public members and private members.   The public member can be used through the class using dot operator.   Where as private me

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