Lecture overview -- Keyboard shortcut: 'u'  Previous page: Organization of classes and members -- Keyboard shortcut: 'p'  Next page: Functions outside classes -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Abstraction Mechanisms, Part 1 - slide 3 : 36

Classes, structs and namespaces

Structs and classes are similar in C++

A class/struct is a namespace "with some extra properties":

point2.cc
Struct Point in C++ .
point-namespace-1.cc
A namespace with struct Point in C++ .
point-namespace-2.cc
Same with illustration of ambiguities relative to the global namespace.