learning cpp
ADVANCE DATA STRUCTURES
C TUTORIAL
CPP Programs
CPP Projects
DATA STRUCTURES THROUGH C
DBMS
DCCN
HOME
Interview Questions
JAVA
Operating Systems
SOFTWARE ENGINEERING
SYSTEM ADMINISTRATION
learn Web Designing
Saturday, 2 October 2010
Unary plus operator overloading using friend function
Unary plus
operator overloading using friend function:
<header files>
class A
{
int x;
A(int=0);
public:
friend A operator +(const A&);
};
A
operator +(const A& Aobj)
{
return A(+A obj .x);
}
operator overloading
Over loading increement and decreement operators:
Over loading relational operators
friend function
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment