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


Please Help Members By Posting Answers For Below Questions

Can bst contain duplicates?

668


What is overriding in oops?

602


Get me an image implementation program.

1557


Why we use classes in oop?

581


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

1608






Can we create object of abstract class?

577


What is object in oop with example?

699


Can a destructor be called directly?

599


What is destructor give example?

603


What does I oop mean?

616


what type of questions

1697


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2066


What is the advantage of oop over procedural language?

627


What is and I oop mean?

618


What is interface in oop?

662