BTW, see also http://msdn.microsoft.com/
Main Topics
Browse All TopicsIs there any difference between the two ro are they the same? If there is any difference what is it??
Thanks,
KM
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
BTW, see also http://msdn.microsoft.com/
Hi KalluMama,
Function overloading is like you have different functions with the same name but different signatures working differently. So, the compiler can differentiate and find out which function to call depending on the context. In case of operator overloading, you try to create your own functions which are called when the corresponding operator is invoked for the operands.
One important thing to understand is that you can create as many functions as you want with the same name and sifferent signatures so that they can work diffrently but for a particular class, you cannot overload the operator function based on number of arguments. There is a fundamental reason behind this.
According to the rules, you can not create your own operators but you have to use already available operators. Another thing is since the operator are already defined for use with buily-in types you can not change their charecteristics. For example the binary operator '+' always takes two parameters, so for this you cannot create a function that takes three parameters. But you can always overload them based on the type of the parameters. Considers the following code fragment.
bash-2.05$ cat a2.cc
#include <iostream>
#include <string>
using namespace std;
class A {
public:
int a;
float b;
char c;
A(int x=0, float y=0.0, char z='\0'):a(x),b(y),c(z) { }
const A& operator + (int x) {
a = a+ x;
return *this;
}
const A& operator + (float y) {
b = b+ y;
return *this;
}
const A& operator + (char z) {
c = c+ z;
return *this;
}
};
int main() {
A m;
A n = m + 4;
A o = m + 1.2f;
A p = m + 'a';
cout << "a = " << m.a << " b = " << m.b << " c = " << m.c << endl ;
return 0;
}
bash-2.05$ ./a.out
a = 4 b = 1.2 c = a
I hope this clears some things.
Cheers!
Not all operators can be overloaded
from http://oopweb.com/CPP/Docu
# Not all operators can be overloaded. Most operators can be overloaded, but there are a few exceptions, which are:
* The ternary operator ?:
* The class/struct member access operator .
* The scope resolution operator ::
Business Accounts
Answer for Membership
by: jkrPosted on 2004-12-07 at 13:42:11ID: 12768609
As operators are threated as member functions, there's hardly any difference - not even with 'global' operators, since you can overload non-member functions also.