Free Online Flashcard Deck

01 C++ Fundamentals and Program Structure Free Online FlashCards

Study 01 C++ Fundamentals and Program Structure with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is the role of `int main()` in a C++ program?

Back

`main` is the program’s entry-point function and returns an integer status to the operating system.

02
Front

What does the `std::` prefix indicate?

Back

The `std::` prefix identifies names provided by the C++ standard library’s `std` namespace and helps prevent name conflicts.

03
Front

How do C++ header and source files commonly differ?

Back

Header files commonly contain declarations, templates, and shared definitions; source files commonly contain function and class definitions.

04
Front

What is a C++ translation unit?

Back

A translation unit is the source produced after an included file’s contents are conceptually incorporated and prepared for compilation.

05
Front

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

Back

Preprocessing handles directives, compilation checks and generates lower-level code, linking combines objects and libraries, and execution runs the executable.

06
Front

What does GCC’s `-c` option do?

Back

The `-c` option stops after compilation, producing an object file without performing the linking stage.

07
Front

How do C++ single-line and block comments differ?

Back

`//` comments continue to the line’s end, while `/* ... */` comments can span multiple lines.

08
Front

What are the basic rules for ordinary C++ identifiers?

Back

An identifier starts with a letter or underscore; later characters may also include digits. Identifiers are case-sensitive.

09
Front

Why can’t `class` be used as a variable name?

Back

A keyword has a predefined language meaning and normally cannot be used as a programmer-defined identifier, such as `class`.

10
Front

What is a literal in C++?

Back

A literal is a value written directly in source code, such as `42`, `3.14`, `'A'`, `"C++"`, `true`, or `nullptr`.

11
Front

How does an expression differ from a statement?

Back

An expression produces a value or performs an operation; a statement specifies an action or control operation. An expression followed by `;` is an expression statement.

12
Front

How does C++ write formatted output to the console?

Back

`std::cout` sends output through the standard output stream using the insertion operator `<<`.