Learn C Programming

Lesson 3 of 8 · The Preprocessor, Headers and Multi File Builds

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

  1. Bob's header breaks the link
  2. Each .c file is compiled on its own
  3. What belongs in a header, and what never does
  4. library.h for Amara's loans
  5. The include guard, and pragma once
  6. static in a header: one copy per file
  7. The standard headers this track has used
  8. inttypes.h: printing an int64_t properly