c plus Flashcards
(61 cards)
What are tokens in C++?
Tokens are the smallest individual units in a program.
What are the types of tokens available in C++?
- Keywords
- Identifiers
- Constants
- Strings
- Operators
Define keywords in C++.
Keywords are reserved words with predefined meanings that cannot be used for other purposes.
What does the ‘auto’ keyword do in C++?
Automatically identifies the data type of a variable based on its initializer.
What is the purpose of the ‘default’ keyword in C++?
Specifies default behavior related to constructors, function arguments, or switch cases.
What does the ‘break’ keyword accomplish in C++?
Exits a loop or switch case statement.
What is the function of the ‘case’ keyword in C++?
Marks a particular case in a switch statement.
What does the ‘char’ keyword represent in C++?
Represents a character type (1 byte).
What does the ‘const’ keyword indicate in C++?
Defines a variable that cannot be changed after initialization.
What is the role of the ‘continue’ keyword in C++?
Skips the current iteration of a loop and proceeds to the next one.
What does the ‘double’ keyword represent in C++?
Represents a double-precision floating-point number.
What is the purpose of the ‘else’ keyword in C++?
Specifies an alternative to the if statement.
What does the ‘enum’ keyword do in C++?
Defines an enumerated data type.
What does the ‘float’ keyword represent in C++?
Represents a single-precision floating-point number.
What is the function of the ‘for’ keyword in C++?
Creates a loop that iterates over a defined range.
What does the ‘if’ keyword create in C++?
Creates a conditional statement that evaluates whether a condition is true or false.
What does the ‘int’ keyword represent in C++?
Represents an integer type, typically 2 or 4 bytes.
What does the ‘long’ keyword represent in C++?
Represents a long integer type, typically 4 or 8 bytes.
What is the role of the ‘namespace’ keyword in C++?
Creates a namespace that can contain variables and functions.
What does the ‘new’ keyword do in C++?
Dynamically allocates memory during program execution.
What is the purpose of the ‘return’ keyword in C++?
Exits a function and optionally returns a value.
What does the ‘short’ keyword represent in C++?
Represents a short integer type, typically 2 bytes.
What does the ‘signed’ keyword specify in C++?
Indicates that a variable can hold negative and positive values.
What does the ‘static’ keyword indicate in C++?
Specifies that a variable or function belongs to the class and is not an instance.