Library files & header files

Hi guys.I have a quuestion.I can't understand exactly library files and header files.For example, thanks to stdio.h file I can use printf function but where is the the source of printf() function? I think that stdio.h includes only the protype of printf function..

Similarly,İf I define a header file for a function and the source file which include this function implementation,Should I create a library file to store source file and header file for my writing files.

Please help.I apologize for my english
where is the the source of printf() function
In GCC it is in glib library linked to any C and C++ program.

Library file is an already compiled source file. It have paired header file which provides access to library functions (and do stuff like specify calling conventions to make sure that different compilers will get function call right)

In most cases you should not bother with making a library from your cpp files. Only if you have something which often used in different projects and have a noticeable compile time you should probably make it.
thank you for your help.Am i right? library file(glib) includes printf.o(object file of the source of printf) and stdio.h?
Well, MinGW uses libmsvcrt.a. Native linux compilers probably uses glibc.a.

There usually single lib, containing whole C runtime and a bunch of headers providing function declaration of part of it.
Topic archived. No new replies allowed.