Preprocessor Directives
- T/F: Preprocessor directives transform the program before compilation.
- T/F: The #define will modify each instance matching the name to the value assigned to it.
- T/F: The #include is a preprocessor directive.
- T/F: Preprocessor directives can be used for conditional compilation based on the type of machine executing the program.
- T/F: NULL is defined as 0 (zero).
- T/F: #define must be declared at the top of the program after all #include statements.
- What is the modifier to use to define constants?
- What is the modifier to use to define macros?
- Define a constant named PI with the first 5 decimal values for PI.
- Define a macro named square to calculate the square of a number.
- Define a macro named getCircumference and write a line of code to make use of the macro you just defined.
- Define a flag for debugging, and write a code fragment that prints whether or not debugging is on, and show the command line to run your program with and without debugging.
- Give an example using the #elif structure.
- What must you end your ifdef with? ifndef? if?
- How are preprocessor directives used to include/exclude parts of a program? Give examples of each.