Tsallaka zuwa abun ciki
Justice Tech School

Header Files and Modules

Put declarations in .h files and definitions in .c files. Use include guards.

Example
#include <stdio.h>

int add(int a, int b) { return a + b; }
int main(void) {
  printf("%d\n", add(2, 3));
  return 0;
}

Result

5

Exercise

Guard macro.

#ifndef 

Quiz Test

What do include guards prevent?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.