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
Can a destructor be called directly?
Give two or more real cenario of virtual function and vertual object
What is the purpose of polymorphism?
Which language is not a true object oriented programming language?
What is coupling in oops?
What is debug class?what is trace class? What differences are between them? With examples.
How do you achieve polymorphism?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What is advantage of inheritance?
officer say me - i am offered to a smoking , then what can you say
What is meant by oops concept?
What is abstraction example?
What is overloading in oops?
can we make game by using c
What is and I oop mean?