What is local class in C++?

What is local class in C++?

- Local class is defined within the scope of a function and nested within a function.

- It is declared inside a function and it becomes local to that function.

Example:
int func1()
{
   class localclass1
   {.....};
}

- It cannot have static data members.

- Inside the local class, member functions must be defined.

- Automatic local variables cannot be used.
What is the default access level? - C++
Default access level - The access privileges in C++ are private, public and protected. The default access....
What is friend class in C++?
Friend class in C++ - When a class declares another class as its friend, it is giving complete access...
Explain default constructor. What is a default constructor?
Default constructor - Default constructor is the constructor with no arguments or all the arguments has default values..
Post your comment