The C - The C+ Standard Library and Reserved Names Jonathan...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The C++ Standard Library and Reserved Names Jonathan Schilling, jls@sco.com The draft ANSI/ISO C++ standard library incorporates by reference much of the C standard library. This has always been the case, back to the earliest days of C++; what has changed during the standardization process is the placement of C standard library names into namespace std, the namespace that also holds the C++ standard library. Thus, a proper C++ program now calls the C standard library like this: #include <cstdio> ... std::printf("hello, old library\n"); rather than in either of the ways it used to: #include <stdio.h> ... ::printf("hello, old library\n"); // explicit scoping // or printf("hello, old library\n"); // lazy but more typical The old forms are still accepted by virtue of a deprecated backward compatibility provision, which states that <stdio.h> has the effect of pulling in <cstdio> and making its std:: names visible as if there were using declarations for them.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

The C - The C+ Standard Library and Reserved Names Jonathan...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online