printf , scanf , and other standard library functions are provided as part of the implementation.
The C implementation consists of several components. The compiler is one of them. The library is different; it consists of headers (usually provided as source files, such as stdio.h ) and some forms of object code files containing code that actually implements library functions.
The stdio.h header only declares these functions; he does not define them. The printf declaration looks something like this:
int printf(const char *format, ...);
The definition of printf is code that actually does the job of parsing a format string, accessing arguments, and sending formatted output to stdout . This is usually (but not required) written in C and provided as some kind of reference object code.
For some C implementations, the compiler and library are provided by the same organization. For others, they can be provided separately (for example, MinGW combines the gcc compiler with the Microsoft library).
source share