Lecture overview -- Keyboard shortcut: 'u'  Previous page: Booleans -- Keyboard shortcut: 'p'  Next page: Declarations and definitions -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 2 - Page 4 : 42
Notes about C++
Basic facilities
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