Basic facilities
- slide 4 : 42
Structs in C++
Structs and classes are almost identical concepts in C++
The C++ Programming Language
: Page 234
C structs in relation to C++ structs
Similar to each other
In C++ it is possible to refer to
struct S {...}
by just
S
, not necessarily
struct S
Both structs in C and C++ are associated with value semantics
C++ structs in relation to C++ classes
A struct is a class where all members are public by default
A struct is typcically used for aggregating public data
Both structs and classes can make use of inheritance