Difference between C/C++ Runtime Library and C/C++ Standard Library

Viewed 19510

Can you guys tell me the difference between them?

By the way, is there something called C++ library or C library?

8 Answers

The C++ Standard Library and C Standard Library are the libraries that the C++ and C Standard define that is provided to C++ and C programs to use. That's a common meaning of those words, i haven't ever seen another definition of it, and C++ itself defines it as this:

The C++ Standard Library provides an extensible framework, and contains components for: language support, diagnostics, general utilities, strings, locales, containers, iterators, algorithms, numerics, and input/output. The language support components are required by certain parts of the C++ language, such as memory allocation (5.3.4, 5.3.5) and exception processing (clause 15).

C++ Runtime Library and C Runtime Library aren't so equally used. Some say a runtime library is the part that a program uses at runtime (like, the code that implements std::type_info or the code supporting signal handlers) as opposed to stuff that they only use at compile time (like macro definitions). Other people say that a runtime library is one that is linked to a program at load time dynamically, as opposed to statically at compile time, though this use is very seldom. shared library or dynamically linked library are better terms for that.

C++ Library and C Library are very broad terms. They just mean that a library is written in C++ and/or C.

The above is not only limited to C++ and/or C. There are python libraries and there is a python Standard Library too.

C++ standard library is a term to define the standard library that a minimum conforming compiler/toolset should have. C++ runtime library is the library shipped with the toolset to provide standard library functionality, and probably some internal stuff the compiler might need. In fact, those terms are often interchangeable.

Another aspect, maybe not exactly the case of C/C++, but according to the wikipedia: Runtime library

In computer programming, a runtime library (RTL) is a set of low-level routines used by a compiler to invoke some of the behaviors of a runtime environment, by inserting calls to the runtime library into compiled executable binary.

To be concise:
Runtime library is meant to be used by the compiler and standard library is meant to be used by the programmer.

C++ runtime library contains functions and objects supplied in C++, such as cout, fstream and so on.

C runtime library contains C functions such as printf, scanf, fopen, and so on.

Related