Answer to Question #257979 in C++ for Amit

Question #257979

 Write a program to overload unary (-) operator using friend function.


1
Expert's answer
2021-10-28T05:22:29-0400
friend int operator-(int n) {
 return -n;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS