October 2025
Intermediate to advanced
241 pages
4h 6m
English
We’ll now consider how to assemble, compile, and build a specific version of a program. The file minmax.c (Listing 6-1) contains code that makes it compile differently based on whether or not the variable C_VERSION is defined at build time. If C_VERSION is defined, lines 12–25 are compiled, otherwise lines 28–29 are compiled. The main() function gets its definition of printMin and printMax based on which section is active. If C_VERSION is defined, min and max are defined as macros, ...
Read now
Unlock full access