vault backup: 2024-11-10 21:01:06

This commit is contained in:
zleyyij 2024-11-10 21:01:06 -07:00
parent 081dfe7116
commit 5fee60ba7b

View File

@ -36,3 +36,7 @@ Output if DEBUG is not defined:
> (c). Explain why the output is different in parts (a) and (b) > (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. 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.
> (d). Is it necessary for the `DEBUG` macro to be defined *before* `debug.h` is included in order for `PRINT_DEBUG` to have the desired effect? Justify your answer.
Macro invocations are evaluated sequentially, and so if `DEBUG` was defined after `PRINT_DEBUG`, then any usages of `PRINT_EVALUATION` would be have like `DEBUG` was not defined.