Answers for "default access specifier for struct in c++"

C++
1

default access modifier in c++ in struct

A structure is a class defined with the struct keyword.
 Its members and base classes are public by default. 
  In practice, structs are typically reserved for data without functions. 
    When deriving a struct from a class/struct, default access-specifier for a base class/struct is public.
Posted by: Guest on July-13-2021
1

default access specifier in c++

By default access to members of a C++ class is private. 

The private members are not accessible outside the class; 
they can be accessed only through methods of the class. 

The public members form an interface to the class and 
are accessible outside the class.
Posted by: Guest on May-14-2021

Browse Popular Code Answers by Language