2080 7

BIT153 ยท 2080 ยท 5 marks

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

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

Object Oriented ProgrammingChapter 2: Classes, Objects, and Data MembersReturning objects from functions

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 ...