Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/14

Click to flip

14 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)
How many preprocessor directives can appear on a single line.
One
Sometimes it's lonely.
What is the #if directive for?
The #if tests a conditional statement. If the statement evaluates to 'true' then all statements between the #if and #endif statements are compiled.
What comparison operators can be used with the #if directive?
==
!=
&&
||
There are only 4.
What other preprocessor directives are used with #if?
#else
#elif
#endif
#define
#undef
There are 5.
What is the #else preprocessor directive used for?
The #else preprocessor directive is used to create an alternate compile path in the case that #if preprocessor directive evaluates to false.
What preprocessor directive must follow #else?
The #endif preprocessor directive must be the next preprocessor directive after #else.
What is the #elif directive used for?
The #elif preprocessor directive allow more complex compile stream logic to be expressed more simply than by nesting #if ... #else ... #endif sequences. #elif accepts that same operators that #if accepts. It must be nested within a #if ... #endif sequence. It is equivalent to using a #else ... #if sequence.
What is the #endif preprocessor directive used for?
The #endif preprocessor directive is used to terminate an #if block.
What is the #define preprocessor directive used for?
It is used to define a symbol that can be evaluated by the #if, #elif preprocessor directive. You can also use the [Conditional("foo")] attribute to control compilation.
What is the preprocessor directive #undef used for?
To undefine an existing symbol, typically defined using the /define compiler options.
What is the purpose of the #warning preprocessor directive?
The #warning preprocessor directive is used to output a message during the compile. Example:
#warning Node connections not yet tested.

For example.
What is the #error preprocessor directive used for?
The #error preprocessor directive is used to output an error message during the compile process.

#error this code section is not fully developed and should not be used.

For example.
What is the purpose of the #line preprocessor directive?
The #line preprocessor directive is used to assign a line number to the following line in the source code. It may also have "default" as an argument so that the line numbering is reset.
What is the purpose of the #region and #endregion preprocessor directives?
They are specific to the Visual Studio environment. They are used to create a block of code that can be expanded and collapsed. #region must be terminated by an #endregion preprocessor directive. Optionally the #region preprocessor directive may have be named. Example: #region myRegion for fun