From 081dfe711624506d8d946a1383becd62b6522f78 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Sun, 10 Nov 2024 20:56:06 -0700 Subject: [PATCH] vault backup: 2024-11-10 20:56:06 --- .../ECE1400/Chapter 15 Exercises.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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