FlashKeepers

C and C++ · College · College and University

C IV: Preprocessor and File I/O

Macros, include guards, conditional compilation, stdio file functions, formatted I/O, command-line arguments and the standard library headers.

About this set

39 basic cards for College C and C++. It opens with "What does #define do?" and "What is a function-like macro?". Study it alongside the other College sets below.

39 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does #define do?
Show answerCreates a preprocessor macro for textual substitution throughout the translation unit
What is a function-like macro?
Show answerA macro that takes parameters and behaves like a function call during preprocessing
What does the # operator do inside a macro?
Show answerConverts a macro parameter into a string literal (stringification)
What does #undef do?
Show answerUndefines a previously defined macro, removing it from scope
What is the scope of a macro?
Show answerFrom its definition to the end of the translation unit
What does the __LINE__ predefined macro represent?
Show answerThe current line number in the source file as an integer constant
What does the __FILE__ predefined macro represent?
Show answerThe name of the current source file as a string literal
What is an include guard?
Show answerA 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 answerPrevents a header file from being included multiple times using a compiler-specific directive
What does #ifdef do?
Show answerChecks if an identifier is currently defined and includes the following code if it is
What does #ifndef do?
Show answerChecks if an identifier is not defined and includes the following code if it is not
What does #if do?
Show answerEvaluates a preprocessor constant expression and includes the following code if the result is nonzero
What does the defined() operator do?
Show answerTests whether an identifier is defined, returning 1 if true and 0 if false, for use in #if expressions
What does #elif do?
Show answerSpecifies an else-if condition in preprocessor conditional compilation

24 more cards in the app

Study this set free