Yes, struct
is exactly like class
except the default accessibility is public
for struct
(while it’s private
for class
).
More Related Contents:
- Self-inherited structure definition in C++
- What is object slicing?
- Thou shalt not inherit from std::vector
- How do you declare an interface in C++?
- Derived template-class access to base-class member-data
- Why do C and C++ support memberwise assignment of arrays within structs, but not generally?
- Why is Default constructor called in virtual inheritance?
- Why should I declare a virtual destructor for an abstract class in C++?
- Iterating over a struct in C++
- Initialize parent’s protected members with initialization list (C++)
- Structure of Arrays vs Array of Structures
- Is it legal to index into a struct?
- “not declared in this scope” error with templates and inheritance [duplicate]
- Are static fields inherited?
- C++ inheritance – inaccessible base?
- Inheritance and templates in C++ – why are inherited members invisible?
- Inheritance and method overloading
- Are parent class constructors called before initializing variables?
- Class vs Struct for data only?
- Calling the base class constructor from the derived class constructor
- Multiple Inheritance from two derived classes
- C++ Structure Initialization [duplicate]
- c++ sort with structs
- c++ issue with function overloading in an inherited class
- Are virtual destructors inherited?
- c++ data alignment /member order & inheritance
- sizeof(struct) returns unexpected value
- default visibility of C++ class/struct members
- What is the meaning of `struct X typedef` vs. `typedef struct X`?
- C++ inheritance and name hiding [duplicate]