#include typedef int HorseCount; typedef char bool; // do constants like this #define HORSE_LIMIT 5 // In C++ you'd do this: // const int HORSE_LIMIT = 5; // Any compiler worth its salt won't allocate memory for this #define false 0 #define true 1 #define expand_3X(A) A A A #define print_start printf( #define print_stop ); void see_horse(HorseCount *sofar){ printf("What a nice horse!\n"); (*sofar)++; } int main(){ HorseCount hc = 1; hc++; see_horse(&hc); see_horse(&hc); see_horse(&hc); see_horse(&hc); see_horse(&hc); printf("We have seen %d horses.\n", hc); bool enough_horses = hc > HORSE_LIMIT; if(enough_horses) printf("That's enough horses for today!\n"); if(enough_horses == false) printf("Let's go find more horses!\n"); printf("enough_horses as an int = %d\n", enough_horses); printf("Thing we're printing: %d\n", 15 + true); printf("%s\n", expand_3X("hi")); // What it expanded to printf("%s\n", "hi" "hi" "hi"); // Silly use of macros print_start "\n" "output\n" "line two\n" "line three\n" print_stop return 0; }