Run-Time Library Question

I

Immortal Nephi

I believe that all global functions come with Run-Time Library are C
programming. The programmer includes <stdio.h> if they want to use
printf function. Why do C++ programming offer <cstdio>? Is it for C
and C++ legacy?

Do all string functions from Run-Time Library are already included in
<iostream> and <string>? Do <iostream> and <string> have missing
functions such as isdigit() and isalpha? Or are they already included
<cctype>?

I guess you may not recommend to use C and C++ legacy. Use Standard C+
+ Library instead of Run-Time Library.
 
J

James Kanze

Immortal Nephi ha scritto:
No, not all of them. For example, std::getline is pure C++.

Not to mention <algorithm>.

[...]
You cannot count on automatic inclusion of other headers.

More precisely, a standard header defines exactly what the
standard says it defines, and (not necessarily) any more. In
C++, a standard header is free to include other standard
headers; this liberty is not granted to the C standard headers,
however, so if you only include <stdio.h> or <cstdio>, you are
guaranteed that <ctype.h> or <cctype> have not been included.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,155
Messages
2,570,871
Members
47,401
Latest member
CliffGrime

Latest Threads

Top