2081 8

Object Oriented Programming20815 marksOverloading unary operators

Write a program to create a class named STUDENT with data member age, then overload the unary operator (++) to increment the age of any object of above class.

Write a program to create a class named STUDENT with data member age, then overload the unary operator (++) to increment the age of any object of above class. [5]

Unary operator overloading allows operators like ++, --, - etc. to work with user-defined class objects. The operator function is defined inside the class using the keyword operator followed by the operator symbol. --- --- --- Step Description ------------------- STUDENT s1(20) Object s1 is creat...

Up nextExplain advantages and disadvantages of inline function.