-
Registered User
operator problemz w/namespace
namespace ops
{
fop_base_class operator , (int s,int u)
{
printf("%i , %i",s,u);
}
};
It gives me this error:
(im using MSVC)
D:\programming dump\fop.cpp(5) : error C2803: 'operator ,' must have at least one formal parameter of class type
Can someone help... ive tried a lot of things... cant figure it out!
SPH
-
of Zen Hall
You can't overload operators for built in types.
-
Registered User
?
What does that mean? Can't overloadglobal operators?
SPH
-
of Zen Hall
No it's nothing to do with whether the variables or operator function is global. You can only overload operators for types you create yourself (with classes), you can't overload for int's alone otherwise the compiler doesn't know whether to use your overloaded operator or the built in one.
Popular pages
Recent additions