a class can be defined inside a block or function


A class can be defined inside a block or function.  This type class is known local class. There are few points to be observed when producing class inside the function or block.

·     Local class can use access global variable with scope operator (::).

·     Local class cannot remain static data member.

·     Local class member function must be defined inside its class that is it can have only inline function.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: a class can be defined inside a block or function
Reference No:- TGS0161146

Expected delivery within 24 Hours