1.4 C++ and C libraries and the std namespace

All C++ standard library names, including the C library names, if you include them, are defined in the namespace std.

Standard library names are defined using the following C++ syntax:

#include <cstdlib> // instead of stdlib.h

This means that you must qualify all the library names using one of the following methods:

  • Specify the standard namespace, for example:

    std::printf("example\n");
    
  • Use the C++ keyword using to import a name to the global namespace:

    using namespace std;
    printf("example\n");
    
  • Use the compiler option --using_std.

Note:

errno is a macro, so it is not necessary to qualify it with a namespace.
Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.