diff --git a/education/software development/ECE1400/Chapter 15 Exercises.md b/education/software development/ECE1400/Chapter 15 Exercises.md index 3675fc5..ef5a070 100644 --- a/education/software development/ECE1400/Chapter 15 Exercises.md +++ b/education/software development/ECE1400/Chapter 15 Exercises.md @@ -18,6 +18,7 @@ Yes, `""` is a path relative to the current file, whereas `<>` is a path to the > **4.** Assume that `debug.h` is a header file with the following contents... >(a). What is the output when the program is executed? + ``` Output if DEBUG is defined: Value of i: 1 @@ -25,5 +26,13 @@ Value of j: 2 Value of i + j: 3 Value of 2 * i + j - k: 1 ``` + > (b). What is the output if the `#define` directive is removed from `testdebug.c`? -> \ No newline at end of file + +``` +Output if DEBUG is not defined: +``` + +> (c). Explain why the output is different in parts (a) and (b) + +When `DEBUG` is defined, any instances of the `PRINT_DEBUG` token are replaced with a `printf` call during compile time, but when it's not defined, they're replaced with nothing. \ No newline at end of file