Macros, include guards, conditional compilation, stdio file functions, formatted I/O, command-line arguments and the standard library headers.
39 cards · basic cards · AI-written, checked twice. Edit anything.
- What does #define do?
Show answer
Creates a preprocessor macro for textual substitution throughout the translation unit
- What is a function-like macro?
Show answer
A macro that takes parameters and behaves like a function call during preprocessing
- What does the # operator do inside a macro?
Show answer
Converts a macro parameter into a string literal (stringification)
- What does #undef do?
Show answer
Undefines a previously defined macro, removing it from scope
- What is the scope of a macro?
Show answer
From its definition to the end of the translation unit
- What does the __LINE__ predefined macro represent?
Show answer
The current line number in the source file as an integer constant
- What does the __FILE__ predefined macro represent?
Show answer
The name of the current source file as a string literal
- What is an include guard?
Show answer
A preprocessor technique using #ifndef, #define, and #endif to prevent a header file from being included more than once
- What is the standard include guard pattern?
Show answer
#ifndef HEADER_NAME ... #define HEADER_NAME ... content ... #endif
- What does #pragma once do?
Show answer
Prevents a header file from being included multiple times using a compiler-specific directive
- What does #ifdef do?
Show answer
Checks if an identifier is currently defined and includes the following code if it is
- What does #ifndef do?
Show answer
Checks if an identifier is not defined and includes the following code if it is not
- What does #if do?
Show answer
Evaluates a preprocessor constant expression and includes the following code if the result is nonzero
- What does the defined() operator do?
Show answer
Tests whether an identifier is defined, returning 1 if true and 0 if false, for use in #if expressions
- What does #elif do?
Show answer
Specifies an else-if condition in preprocessor conditional compilation