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
if one won't explicitly call the destructor of a local; then how does he handle the above situation?

Develop G-code generating software Project Description: I'm presently using Slicer on a polymer jetting 3d printer. The toolpaths were thought out for FDM printers and thus a

We need an E Commerce site likefifacointrader. you must have experience with that kind of work You have to show a sample of work like that site. Skills required are C Prog

#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets

Pebble Merchant Problem Description 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

In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc

Aim: To implement a program to find area of rectangle, surface area of box and volume of box using virtual functions. Code:                       class rect {

Write a c++ 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 c

C CODE FOR PEBBLE MERCHANTS PROBLEM

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome