2080 7

Object Oriented Programming20805 marksReturning objects from functions

Write a program to demonstrate returning object from functions in C++.

Write a program to demonstrate returning object from functions in C++. [5]

In C++, a function can return an object of a class just like it returns any other data type. The returned object is a copy of the local object created inside the function. Point Explanation -------------------- Return type The return type of add() is Rectangle (a class type) Local object temp is ...

Up nextHow 'this' pointer is used to resolve name conflict between local variable and member vari