Lecture overview -- Keyboard shortcut: 'u'  Previous page: Classes, structs and namespaces -- Keyboard shortcut: 'p'  Next page: Constructors -- 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 4 : 36

Functions outside classes

In contrast to similar object-oriented languages, C++ allows functions and variables outside classes

Helper functions are typically wrapped in a namespace together with one or more classes.

In the simple case they are placed in the global name space together with the classes

Seen from the C perspective: funtions and variables outside classes represent backward compatibility

Compared with Java and C#: Less emphasis on static variables and methods