Lecture 2 - Slide 4 : 29
Structs in C++
Structs and classes are almost identical concepts in C++
The C++ Prog. Lang. (3. edition)
:
Page 234
The C++ Prog. Lang. (4. edition)
: Page 47, 454
Structs in C
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