nazerke
8/11/2018 - 4:25 PM

C preprocessor example

#include <stdio.h>
#include <stdlib.h>
	
int main (void) {
  printf ("Hello World\n");
  return EXIT_SUCCESS;
}

The preprocessor would take this code and basically transform it into this:

int printf(const char *, ...);

int main (void) {
  printf ("Hello World\n");
  return 0;
}

In actuality, the result of the preprocessor is a few thousand lines long,
since it includes the entire contents of stdio.h and stdlib.h, which have many 
other function prototypes and type declarations. However, these do not affect 
our code (the compiler will know those types and functions exist, but since we 
do not use them, they do not matter).