Module 15 · The Preprocessor, Headers and Multi File Builds
Header Files: Declarations, Guards and What Belongs Where
ProReading
Bob's click counter has grown, so he splits it into three files. counter.h holds what both code files share, and Bob puts the counter itself there too: int count = 0;.
Pro lesson
This one goes deeper
It is included with this track and with Learn Pro. Every question on the Skill Test can be answered from the free lessons, so this is depth and never a gate on the certificate.
What is inside Header Files: Declarations, Guards and What Belongs Where
- Bob's header breaks the link
- Each .c file is compiled on its own
- What belongs in a header, and what never does
- library.h for Amara's loans
- The include guard, and pragma once
- static in a header: one copy per file
- The standard headers this track has used
- inttypes.h: printing an int64_t properly