What is the C ++ Standard Runtime Library


9.18 Functions of the runtime library

Functions like printf () or scanf () are functions as you have already seen and used in the previous chapters. These are, for example, functions of the runtime library , which are included with every compiler. These functions are supplied with your compiler as object code. However, they still have to be made known to the compiler using the header files of the functions:

Besides the functions printf () and scanf () there are of course a lot more functions in the header file . All can be used in one program as soon as the corresponding header file has been included. It is common practice to see what useful functions of a header file can be used in a program before reprogramming functions yourself. Take a closer look at the with an editor. It can usually be found in the / usr / include directory on Linux / UNIX and often in the C: \ path_to_compiler \ include directory on Windows. There are also a lot more header files with ANSI – C compilers, which in turn contain ready-made functions. The corresponding object code for the header files of the runtime library can be found in the LIB directory of the compiler.

If you look at the header file with a text editor, you will see the function definitions of e.g. B. find printf ():

int printf (const char * format, ...);

The linker downstream of the compiler ensures that these functions are automatically integrated into the program.



your opinion

How did you like the Openbook? We always look forward to your feedback. Please send us your feedback as an e-mail to [email protected]