Explain function overloading, C/C++ Programming

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);

}

Posted Date: 9/20/2012 7:49:47 AM | Location : United States







Related Discussions:- Explain function overloading, Assignment Help, Ask Question on Explain function overloading, Get Answer, Expert's Help, Explain function overloading Discussions

Write discussion on Explain function overloading
Your posts are moderated
Related Questions
algo of stack using two queue

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Private derivation If no specific derivation is listed, then a private derivation is supposed. If a new class is derived privately from its parent class, then: The priva

Syntax rules for writing a destructor function Its name is the similar as that of the class to which it belongs, except that the first character of the name is the symbol t

Define the Char Data Type of C Language? The char defines characters. The char type will usually require only 1 byte of internal storage. Every char type has an equivalent inte


Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Reference Types The symbol "&" is interpreted as an address operator as well as AND operator. This operator is also used to declare a "reference variable". A reference is refer

What is  T y pe C a s t Op er a t o r :   T h e f l o a t c a n b e c o n v e r t e d t o i n t e g e r v a l u