Explain function overloading, C/C++ Programming

Assignment Help:

Function overloading:

Functions can be defined with same name.  Depending upon the type of argument passed

the function will perform.  This is known function overloading.  It may look like calling the same function but really it is not. This is also called as function polymorphism.

int f_over(int x);

float f_over(float a, float b);

void main( )

{int a=10;

float x=11.11,y=22.2,z;

c =f_over(a); //The value of c is 10

}

int f_over(int x);

{return (x)

};

float f_over(float x, float y)

{return (x/y);

}


Related Discussions:- Explain function overloading

#CompilerRelated, #C Why don''t online compilers support the header file?...

#C Why don''t online compilers support the header file? What can I do to resolve this? PS. I have tried , does''nt work either. Thannk in advance.

Explain the goto statement, The goto statement This statement can be us...

The goto statement This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though

Function, give an example of function

give an example of function

Make a list of functions that are standard in cpp, Make a list of functions...

Make a list of functions that are standard in C++. You must include each of the following for each function: Name of function Its parameters Data type it returns

What are header files and what are their uses, What are header files? What ...

What are header files? What are their uses? - Header files are also known as library files. - They carry two significant things: definitions and prototypes of functions bein

How must runtime errors be handled in c++, How must runtime errors be handl...

How must runtime errors be handled in C++ - Runtime errors in C++ can be handled using exceptions. - This exception handling mechanism in C++ is developed to handle errors i

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