About Lesson
When working on a big project, the program would most likely be divided into several source files. For example, when building a system to handle student record, we may have the following files:
- main.c : file containing the main function.
- read.c : file that contains functions related to fetching student data.
- write.c: file containing functions related to saving data.
- sort.c : file with functions related to sorting student records.
- calc.c : file having functions to perform calculations like final score, grade, etc.
- search.c : file with functions to search student records for data related to a specific student, etc.
Files like sort.c, calc.c and search.c may have functions that are more generic and could be used in other projects as well. So, they could be separately-compiled libraries in a real-world scenario. We would have corresponding header files sort.h, calc.h and search.h containing function declarations and macro definitions. We could include these in the files where we reference the functions from these headers using #include.
#include <<header file name>>
We have already been using stdio.h header file in most of our programs.