Week 5: Preprocessor Flashcards

1
Q

What does the preprocesser make up one half of?

A

The compiler directive, the other half being the compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In a nutshell, what does the preprocessor do?

A

Finds #include file and #define macros.
Include files are programatically placed where the #include tags are.
Defined macros are replaced throughout the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 2 main benefits of macro pre-processing?

A
  • Reduces overhead on the call stack, thus improves efficiency.
  • Enables elimination of global variables.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the command line argument ggc -I do?

A

Specifies a search path for the compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define the difference between #include < > and #include “ “

A

< > makes the compiler search the standard path.
“ “ makes the compiler search the immediate directory of the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is selective compilation?

A

Enables conditional statements to be executed in the context of pre-processing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 6 main selective compilation tags?

A

ifdef
ifndef,
else
elif
endif
undef -> Undefines a macro or symbol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 5 most useful predefined macros?

A

__FILE__
__LINE__
__DATE__
__STDC__
__TIME__

How well did you know this?
1
Not at all
2
3
4
5
Perfectly