Is following functions are said to be overloaded?
int add(int a,int b)
char *add(int a,int b)
Answers were Sorted based on User's Feedback
Answer / arunkumar995
Function overloadig can not be achive only chaining the
return type.We must havv to change the aruments.
int add(int a,int b)
char*add(int a,int b)
one think that return type not make important role in
function overloading.In fun Overloading must effect on the
arguments.
Thus we say the given [int add(int a,int b)
char*add(int a,int b)]is not function overloaded.
Is This Answer Correct ? | 6 Yes | 1 No |
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 |
Answer / ajay singh
No above function is not overloaded .... function over
loading can take place if the signature of the function is
different and the signature of the function do not include
the return type
Is This Answer Correct ? | 0 Yes | 0 No |
Get me a number puzzle game-program
can we create and enter the data & hide files using programmes ?
Please send ford technologies placement paper 2 my mail id
what is the main difference between sizeof() operator in c and c++
What is polymorphism? Explain with an example.
write a program which best describes polymorphism in real world?
2 Answers CTS, Infosys, NexGen,
what is the advantage in software? what is the difference between the software developer and Engineer
what is difference between class template and template class?
Can abstract class have normal methods?
Why static Function is used in C++?
can you give the dynamic polymorphism types?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?