Is following functions are said to be overloaded?
int add(int a,int b)
char *add(int a,int b)
Answer Posted / abilask
Yes the said funtion add is overloaded.
But it is in ambiguous state because of passing element is
same.
Compiler will differ with the passing elements, but dont
consider the return value.
In this quiestion the two add funtion having two different
return type int & char * respectively.
I think the below one will be correct example for
overloaded function.
int add(int a,int b);
char *add(float a,int b);
| Is This Answer Correct ? | 8 Yes | 7 No |
Post New Answer View All Answers
Is react oop?
What are the three parts of a simple empty class?
What are the 4 pillars of oop?
Whats oop mean?
What are functions in oop?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
Can an interface inherit a class?
Can bst contain duplicates?
What is polymorphism used for?
What is overriding vs overloading?
What is a class and object?
What is abstraction with example?
What is polymorphism in oop example?
• What are the desirable attributes for memory managment?