Where does a hosted C++ program begin execution?
Execution begins in the global function named `main` in a hosted C++ environment.
Study 1 C++ Foundations and Syntax with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
Where does a hosted C++ program begin execution?
Execution begins in the global function named `main` in a hosted C++ environment.
What are the main stages from C++ source to execution?
Preprocessing handles directives, compilation translates source into object files, linking combines objects and libraries, and execution runs the resulting executable.
How does a C++ single-line comment begin?
A single-line comment begins with `//` and continues to the end of the line.
Why cannot `class` normally be used as a variable name?
A keyword is a reserved word with special meaning in C++, so it cannot normally be used as a variable, function, or class name.
What rules apply to C++ identifiers?
An identifier may contain letters, digits, and underscores, but it cannot begin with a digit, be a keyword, or use reserved implementation-style names.
How do character and string literals differ in C++?
A character literal uses single quotes, such as `'A'`; a string literal uses double quotes, such as `"C++"`.
What value does `nullptr` represent?
`nullptr` represents the null pointer value in C++.
How is `2 + 3 * 4` grouped by operator precedence?
Multiplication and division generally bind more tightly than addition and subtraction, so `2 + 3 * 4` evaluates as `14`.
What is the difference between `=` and `==`?
`=` assigns a value, whereas `==` tests whether two values are equal.
How does C++ print a value to standard output?
`std::cout` sends data to standard output, normally the console, using the insertion operator `<<`.
How does C++ read formatted input?
`std::cin` reads formatted input from standard input using the extraction operator `>>`.
What does the `std::` prefix indicate?
The `std::` prefix identifies a name from the standard library’s `std` namespace, such as `std::cout`.