Difficulty: Easy
Correct Answer: _ (underscore)
Explanation:
Introduction / Context:Valid identifiers are essential for readable, portable code. C and C++ restrict variable names to a specific character set so compilers can parse tokens unambiguously. This question checks your knowledge of which special symbol is permitted within a variable name without invoking operator parsing or undefined behavior.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Solution:
Eliminate operator characters: '' (multiplication), '|' (bitwise OR/pipe), '-' (minus/negation).Confirm the remaining candidate '' as valid within identifiers.Hence, the allowed special symbol is the underscore.Verification / Alternative check:
Try compiling variables named data_value, value2, and a-b; only the hyphenated name fails because '-' is parsed as an operator.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
_ (underscore)
Discussion & Comments