1/21
Flashcards about the C preprocessor
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the C preprocessor (CPP)?
Used automatically by the C compiler to transform your program before compilation.
What is the C preprocessor (CPP) also known as?
A macro processor that allows you to define macros, which are brief abbreviations for longer constructs.
What end-of-line markers does GCC accept?
LF, CR LF, and CR
What is a continued line in C preprocessing?
A line which ends with a backslash, “\”.
What happens to comments during initial processing in C preprocessing?
Replaced with single spaces.
What types of preprocessing tokens exist?
Identifier, Number, String literals
What does the preprocessing language consist of?
Directives and Macros
What are the primary capabilities of the preprocessing language?
Macro expansion, Conditional compilation, Diagnostics, Inclusion of header files, Control the compiler
What does an object-like macro do?
Replaces an identifier with a code fragment.
How are macros defined?
Using the #define directive.
What are function-like macros?
They look like a function call.
What is stringification (or stringizing) in C preprocessing?
Converts a macro parameter into a string constant.
How can a macro be undefined?
With the #undef directive.
What is '##' known as?
Token pasting operator
What directives begin a conditional in the C preprocessor?
What does the #if directive allow you to do?
To test the value of an arithmetic expression.
What does the #else directive do?
Provides alternative preprocessing language if the condition fails.
What do the directives #ifdef and #ifndef do?
Checks if an object-like identifier or function-like identifier has been defined.
What are some examples of predefined macros?
FILE, LINE
How are header files included using the preprocessing directive #include?
How do you prevent double inclusion of a header file?
Enclose the entire C code of the header file in a conditional.
How does a computed #include work?
The header file is specified externally as a compiler option.