Lecture 4 - Slide 1 : 40
Classes, structs and namespaces
Structs and classes are similar in C++
A class/struct is a namespace "with some extra properties":
The C++ Prog. Lang. (3. edition)
:
Page 234,849
The C++ Prog. Lang. (4. edition)
: Page 454
Class
Defines a named type where members are private by default
Typically used for user-defined types
A namespace "with some extra properties":
Struct
Defines a named type where members are public by default
Typically used for aggregation of public data
A namespace "with some extra properties":
Namespace
A scope
Named or unnamed
There is a global namespace
Namespaces - logical program organization