C Programming Practice Test: C Preprocessor — Flashcards | C Programming | FatSkills

C Programming Practice Test: C Preprocessor — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

Quiz questions on pragma, stringizers, conditional preprocessor directives and token concatenation.

The C preprocessor is a macro processor that automatically transforms a program before compilation. It allows you to define macros, which are brief abbreviations for longer constructs. The preprocessor provides inclusion of header files, macro expansions, conditional compilation, and line control. It also makes three transformations on all input: Replaces C comments with single spaces, Deletes Backslash-Newline sequences, and Replaces predefined macro names with their expansions. 

The preprocessor is the first step in compiling a C program. It responds to directives in the code, which give it instructions on how to edit the source code. Pre-processing directives are lines in the program that start with the hash symbol #

Here are some preprocessor directives:
#if:
Evaluates the expression or condition
#else: Evaluates the expression or condition if the condition of #if is false
#error: Indicates an error
#pragma: Provides additional information to the compiler 

You can define a macro in C using the #define preprocessor directive. For example, #define PI 3.1415.

1 of 13 Ready
The preprocessor directive used to give additional information to the compiler, beyond which is conveyed in the language _____________
#pragma
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password