Lecture overview -- Keyboard shortcut: 'u'  Previous page: Example of program organization -- Keyboard shortcut: 'p'  Next page: Point Exercise - C++ versus C# -- 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 41 : 42
Notes about C++
Basic facilities
The standard library namespace

All facilities in the C++ Standard Library are defined in the std namespace

  • Namespace resolution

    • Use the scope operator :: on every name you use from the standard name space

      • std::cout << s1 << std::endl;

      • Allows for symmetric use of the same names from other namespaces

      • Tedious in short and simple programs

    • Apply using declarations on selected names from the standard namespace

      • using std::cout; using std::endl;

      • Tedious, just in another way...

    • Apply a single using directive

      • using namespace std;

      • All names from the standard namespace can be used without qualifiction

      • OK for namespace composition - OK in certain local scopes

      • Sloppy and lazy if used in the global namespace

  • The C++ Programming Language: Page 179: Namespace composition