In typical C/C++ projects, source header files frequently use which filename extension to indicate a header (choose the most common traditional extension)?
-
A.H
-
B.HE
-
C.HEA
-
D.HEAD
-
ENone of the above
Answer
Correct Answer: .H
Explanation
Introduction / Context:Header files declare interfaces, types, and function prototypes that can be shared across multiple translation units. While modern C and C++ standard headers are often referenced using angle brackets without a file extension (for example,
Given Data / Assumptions:
- The question targets conventional, legacy, or platform-neutral naming practices.
- We are not restricting to the C++ standard library naming scheme; we consider user headers as well.
- Case sensitivity may vary by operating system; .H and .h are conceptually the same family.
Concept / Approach:The most traditional and widely recognized extension for header files is .h (lowercase), and on some systems .H (uppercase) appears equivalently. None of the other listed extensions are standard practice for C or C++ headers. Therefore, among the provided choices, .H is the correct selection standing for the common header extension family.
Step-by-Step Solution:Identify the typical header extension used by C and C++ projects: .h.Map to the provided options, noting that .H represents the same convention in uppercase.Exclude nonstandard endings such as .HE, .HEA, and .HEAD.Conclude that .H is the best match among the available options.
Verification / Alternative check:Examine open source projects across platforms; user headers consistently appear as .h. On case-sensitive filesystems, .H may be a stylistic or historical alternative, but remains recognizable as a header extension compared with the nonstandard alternatives listed.
Why Other Options Are Wrong:
- .HE, .HEA, .HEAD are not recognized extensions in conventional C or C++ build systems.
- None of the above is incorrect because .H matches the common header extension convention.
Common Pitfalls:Confusing modern standard headers like
Final Answer:.H.