Kamis, 27 Oktober 2016

How to overload a unary operator in C++

When a friend function is used to overload an unary operator following points must be taken care of: The function will take one operand as a parameter. The operand will be an object of a class. The function can access the private members only though the object. The function may or may not return any value. The friend function will not have access to the this   Following program demonstrates overloading an unary operator using a friend function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

The post How to overload a unary operator in C++ appeared first on Coding Security.


How to overload a unary operator in C++
read more

Tidak ada komentar:

Posting Komentar