2081 7

BIT153 ยท 2081 ยท 5 marks

How do you return object in function? Describe with an example.

How do you return object in function? Describe with an example. [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 return type of the function is specified as the class name, and the return statement returns an object of that class. Syntax: --- - The return type of the function must be the class name. - A temporar...