Rabu, 08 Maret 2017

How to create a class inside a function in C++

A class which is declared inside a function is called a local class. A local class is accessible only within the function it is declared. Following guidelines should be followed while using local classes: Local classes can access global variables only along with scope resolution operator. Local classes can access static variables declared inside a function. Local classes cannot access auto variables declared inside a function. Local classes cannot have static variables. Member functions must be defined inside the class. Private members of the class cannot be accessed by the enclosing function if it is not declared as a friend

The post How to create a class inside a function in C++ appeared first on Coding Security.


How to create a class inside a function in C++
read more

Tidak ada komentar:

Posting Komentar