/******** * If the code is run with NO_WORKIE 0 then the output is * * Hello World 0 * Hello World 1 * Hello World 4 * * If the code is run with NO_WORKIE 1 then the output is * * Hello World 0 * Hello World 1 * Hello World 2 * Hello World 3 * Hello World 4 * * The only difference being how the array of bool is declared. * */ #define NO_WORKIE 0 void bug2() { #if NO_WORKIE bool second_check[5] = {true, true, false, false, true}; #else bool second_check[5]; second_check[0] = true; second_check[1] = true; second_check[2] = false; second_check[3] = false; second_check[4] = true; #endif for(int i = 0; i < 5; i++) { if(second_check[i] && i == 0) { printf("Hello World %d\n", i); } else if(second_check[i] && i == 1) { printf("Hello World %d\n", i); } else if(second_check[i] && i == 2) { printf("Hello World %d\n", i); } else if(second_check[i] && i == 3) { printf("Hello World %d\n", i); } else if(second_check[i] && i == 4) { printf("Hello World %d\n", i); } } }