Free Online Flashcard Deck

1 C++ Foundations and Syntax Free Online FlashCards

Study 1 C++ Foundations and Syntax with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

Where does a hosted C++ program begin execution?

Back

Execution begins in the global function named `main` in a hosted C++ environment.

02
Front

What are the main stages from C++ source to execution?

Back

Preprocessing handles directives, compilation translates source into object files, linking combines objects and libraries, and execution runs the resulting executable.

03
Front

How does a C++ single-line comment begin?

Back

A single-line comment begins with `//` and continues to the end of the line.

04
Front

Why cannot `class` normally be used as a variable name?

Back

A keyword is a reserved word with special meaning in C++, so it cannot normally be used as a variable, function, or class name.

05
Front

What rules apply to C++ identifiers?

Back

An identifier may contain letters, digits, and underscores, but it cannot begin with a digit, be a keyword, or use reserved implementation-style names.

06
Front

How do character and string literals differ in C++?

Back

A character literal uses single quotes, such as `'A'`; a string literal uses double quotes, such as `"C++"`.

07
Front

What value does `nullptr` represent?

Back

`nullptr` represents the null pointer value in C++.

08
Front

How is `2 + 3 * 4` grouped by operator precedence?

Back

Multiplication and division generally bind more tightly than addition and subtraction, so `2 + 3 * 4` evaluates as `14`.

09
Front

What is the difference between `=` and `==`?

Back

`=` assigns a value, whereas `==` tests whether two values are equal.

10
Front

How does C++ print a value to standard output?

Back

`std::cout` sends data to standard output, normally the console, using the insertion operator `<<`.

11
Front

How does C++ read formatted input?

Back

`std::cin` reads formatted input from standard input using the extraction operator `>>`.

12
Front

What does the `std::` prefix indicate?

Back

The `std::` prefix identifies a name from the standard library’s `std` namespace, such as `std::cout`.