1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#define DEBUG
#ifdef DEBUG
#define print_num(x) printf("The value of %s is %d on line %d of file %s\n", #x, (x), __LINE__, __FILE__)

#define print_compile_time printf("compiled at %s on %s\n", __TIME__, __DATE__)
#else
#define print_num(x)
#define print_compile_time
#endif

int main(int argc, char *argv[]) {
    print_compile_time;
    int i;
    for(i=0; i<8; i++) {
        if(i % 4 == 0) { // BUG
            printf("even\n");
        }
        print_num(i);
    }
    return 0;
}

This content is protected and may not be shared, uploaded, or distributed.    © 2019 Alexander J. Quinn.