Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program for function overloading?

Answer Posted / narmadha

same function name with multiple definitions

#include <iostream.h>
void print(int i)
{
cout << " int " << i << endl;
}
void print(double f)
{
cout << " float " << f << endl;
}
void print(char* c)
{
cout << " char " << c << endl;
}
int main()
{
print(10);
print(10.10);
print("a");
return 0;
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is byval and byref? What are differences between them?

2210


What is overloading and its types?

1160


What is super in oop?

1169


What are the three main types of variables?

1120


What is the renewal class?

2749


What is debug class?what is trace class? What differences are between them? With examples.

2186


Whats oop mean?

1030


Is html an oop?

1053


Why is static class not inherited?

1099


What is polymorphism explain?

1247


Which method cannot be overridden?

1085


What is destructor in oop?

1024


Why is object oriented programming so hard?

1075


What is a superclass in oop?

1169


What are main features of oop?

1119