Local Classes 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
The post What is the difference between local class and nested class in c++ appeared first on Coding Security.
What is the difference between local class and nested class in c++
read more
Tidak ada komentar:
Posting Komentar