GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 173 of 258    Print  
What is function overloading and operator overloading?

  
Total Answers and Comments: 1 Last Update: January 25, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 25, 2006 06:36:32   #1  
samiksc Member Since: October 2005   Contribution: 233    

RE: What is function overloading and operator overloa...

Function overloading refers to having two or more methods in the same scope which have the same name but different signature. (Note that a function signature includes name of the function ordered list of parameter data types. It DOES NOT include the return type and the names of parameters.) For example a class implementing geometrical functions may have several overloaded versions of 'CalculateArea()' function.

Operator overloading refers to writing a different implementation for existing operators. For example a class implementing logic for complex numbers may provide an overloaded version of '+' operator which will add two complex numbers.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Hi, This is a typical example of reflection. If you are using .NET then use reflection for this purpose. In this case you create an object of a particular  type and the invoke methods at run time by passing function name. ...

Latest Answer : pass multiple variables to the function as formal parameters ... function will actually set those values (output variables). ...

Latest Answer : In C++, assignment and copy construction are different because the copy constructor initializes uninitialized memory, whereas assignment starts with an existing initialized object. If your class contains instances of other classes as data members, the ...

Latest Answer : Overloading is related to the use of a function or an operator. For example you can use a function for adding some integers as well as floats so this function is overloaded as it works for two different kind of inputs. Where as overiding is in the case ...

Latest Answer : "Postincrement is usually less efficient than preincrement because it has to remember & return its original value"That is, apart from also doing the increment operation, Postincrement has to remember & return its original value.Exceptional ...

Latest Answer : Do any operation symbolizing the operator in your class.you can add/subtract/multiply/divide or do any other operation for +operator() the choice is entirely yours.Freedom you see ...

Latest Answer : gets does NOT check the size of the buffer and overflow on the stack can occour. Because of this, you should use fgets in preferance. ...

How will you declare an array of three function pointers where each function receives two ints and returns a float?

Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

Latest Answer : XOR Operator is right. XOR the given bit with 1 if the bit is 1 then 0 is the o/p else 1 is the o/p. ...


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

C++ Dereference Operator

C Dereference Operator In this C tutorial you will learn how to access the value of variables pointed by the pointer variables using pointer concept discussed in detail mosgoogle center It is possible to access the value of variables pointed by the pointer variables using pointer This is performed
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

C++ Operator Overloading Part II

C Operator Overloading Part II Operator overloading is a very important aspect of object oriented programming Binary operators can be overloaded in a similar manner as unary operators In this C tutorial you will learn about Binary Operating Overloading explained along with syntax and example mosgoog
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape