ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  OOPS
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
WHY  FUCTION OVERLOADING DOSENOT RETURN  A RETEN TYPE
 Question Submitted By :: Ashis
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE
Answer
# 1
Function overloading has a return type...

Ex:
#include<iostream>
using namespace std;
//Function 1:

int max(int a, int b)
{
   return (a>b)? a:b;
}

//Function 2:

float max(float a, float b)
{
   return(a>b)? a:b;
}

int main()
{
   int c;
   float d;
   c=max(5,4);        //will display 5
   cout<<c<<endl;
   d=max(3.14,6.15);  //will display 6.15
   cout<<d<<endl;
   return 0;
}

Important Concepts in Fn. Overloading:
a) Fun Overloading depends upon the type/number/order in 
which the arguments are passed...
b) Fun Overloading can take place for a function which is 
within the same scope... (i.e.) both function 1:, and 
Function 2: should be in the same { ...} (both the 
functions are within main() (i.e. same scope)...
 
Is This Answer Correct ?    0 Yes 0 No
Manjunathtek
[Teknoturf Info Services Pvt. Ltd]
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
What is polymorphism? Explain with an example.  7
Name an advantage of array over linked list? IBM12
how to swap to variables without using thrid variable in java?  3
What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.  2
What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?  1
When will a constructor executed?  2
what is the function of 'this' operator ?  4
how do u initialize the constant variables Siemens4
write a c++ program to find maximum of two numbers using inline functions.  1
What is the output of the following code: int v() { int m=0; return m++; } int main() { cout<<v(); } 1) 1 2) 0 3) Code cannot compile  3
Can we call a base class method without creating instance?  4
Which is the parameter that is added to every non-static member function when it is called?  3
tell about copy constructor Siemens1
can you explain how to use JavaBean in Project Infosys1
When is it necessary to use member-wise initialization list in C++?  1
What are the main differences between procedure oriented languages and object oriented languages?  4
What is abstraction?  6
What is a template?  5
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization? IntraLogic1
What is public, protected, private? Satyam4
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com