From the course: C Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding header files and libraries

Understanding header files and libraries - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

Understanding header files and libraries

- It's common for beginning C programmers to confuse header files with C language libraries these are two different things. Traditionally, the header files are found on a Unix system in the user include, subdirectory. And there they are. So when you use and include preprocessor directive with angle brackets, this is the location from which header files are fetched, including the popular one here stdio.h. The contents of these files are C language code. You see definitions, prototypes and processor directives listed. Library files are traditionally located in the usr lib directory. And there they are. When you create a C program, the linker looks in this directory for libraries to link in, such as the standard C library, which contains definitions for C functions such as printf and fopen. These are object code files, exactly like those created by the compiler. They contain binary data, not C language code. Other…

Contents