SCC.131: Digital Systems - The C preprocessor

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/21

flashcard set

Earn XP

Description and Tags

Flashcards about the C preprocessor

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

What is the C preprocessor (CPP)?

Used automatically by the C compiler to transform your program before compilation.

2
New cards

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.

3
New cards

What end-of-line markers does GCC accept?

LF, CR LF, and CR

4
New cards

What is a continued line in C preprocessing?

A line which ends with a backslash, “\”.

5
New cards

What happens to comments during initial processing in C preprocessing?

Replaced with single spaces.

6
New cards

What types of preprocessing tokens exist?

Identifier, Number, String literals

7
New cards

What does the preprocessing language consist of?

Directives and Macros

8
New cards

What are the primary capabilities of the preprocessing language?

Macro expansion, Conditional compilation, Diagnostics, Inclusion of header files, Control the compiler

9
New cards

What does an object-like macro do?

Replaces an identifier with a code fragment.

10
New cards

How are macros defined?

Using the #define directive.

11
New cards

What are function-like macros?

They look like a function call.

12
New cards

What is stringification (or stringizing) in C preprocessing?

Converts a macro parameter into a string constant.

13
New cards

How can a macro be undefined?

With the #undef directive.

14
New cards

What is '##' known as?

Token pasting operator

15
New cards

What directives begin a conditional in the C preprocessor?

if, #ifdef, #ifndef

16
New cards

What does the #if directive allow you to do?

To test the value of an arithmetic expression.

17
New cards

What does the #else directive do?

Provides alternative preprocessing language if the condition fails.

18
New cards

What do the directives #ifdef and #ifndef do?

Checks if an object-like identifier or function-like identifier has been defined.

19
New cards

What are some examples of predefined macros?

FILE, LINE

20
New cards

How are header files included using the preprocessing directive #include?

include - for system header files, #include "file.h" - for header files in your project path.

21
New cards

How do you prevent double inclusion of a header file?

Enclose the entire C code of the header file in a conditional.

22
New cards

How does a computed #include work?

The header file is specified externally as a compiler option.