 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can implement Unary Operator Overloading in C++. Before starting, you can note my information. You can connect with me by following these details. You can download my app Techimus that is available on Google Play. You can search my channel on YouTube by typing my name in YouTube search bar. My channel will be available there. You can open it. If you want to follow my videos, you can subscribe my channel. Here, various program related videos and playlists are available. Now, coming on to the topic, I am going to demonstrate you the use of Unary Operator Overloading and how it can be implemented in C++. First, I have included a header file iostream. Then, I have used a namespace that is std, then name of classes number. Here, an integer variable as attribute is declared. Then, in public section, first read function is implemented. It will display enter the number message on console and the number will be stored inside n variable. Then, print function. It will display value on console that is available inside n variable. Then, third increment function is defined, which is increasing value of n by 1. After that, main function is implemented. Here, object n1 is created. It is calling read function. Then, it is calling print function. So, the value which is entered by the user through read function will be displayed on console using print. Then, increment function will increase the value of attribute and then print function will again display that value on console. So, right now, I have not implemented Unary Operator Overloading. It is, this program is implemented without using Unary Operator Overloading. So, first, I am executing this code. Then, I will be converting it with the help of Unary Operator Overloading. So, I am entering 5. You can see the output. Value equals to 5 and value equals to 6. 5 is before increment and 6 is after increment. Now, I am converting this function into overloaded operator function. So, this is overloaded operator function. And this is for Unary Operator. And here, I have to use this plus plus n1. So, you can see I have removed function name and I have placed an operator symbol in place of function name with the help of operator keyword. And same at calling time, I have used plus plus operator in place of function name. So, whenever you want to apply an operator on object of the class, then you have to overload that operator and you have to define a definition for that operator. This concept is known as operator overloading. Now, I am again executing this code. I am entering 5. You can see the output. It is printing same result. So, friends, if you want to apply operators on objects of the class, then you have to overload that operator and that overloaded operator becomes, sorry, that overloaded operator have to define a function definition. And that operator symbol is treated as a function name. And you have to use a keyword that is operator at the time of function definition. So, if Unary Operator Overloading is implemented, then these parenthesis will be blank. If binary operator overloading is implemented, then you have to pass an argument here because binary operators applied on two arguments and Unary operators are applied on one argument. So, this is all about Unary Operator Overloading. I hope you have understood this concept how you can convert a normal function into overloaded operator function. If you want to watch more programming related videos, you can visit my YouTube channel. Thank you for watching this video.