Back to Blog
Programming Languages
14 August 20263 min readUpdated 14 August 2026
Understanding C++ Identifiers
C++ Identifiers In C++, every variable requires a distinct name, known as an identifier . Identifiers can range from concise names like and to more descriptive ones such as , ,...
C++ Identifiers
In C++, every variable requires a distinct name, known as an identifier. Identifiers can range from concise names like x and y to more descriptive ones such as age, sum, or totalVolume. Using descriptive names is advisable to make code easier to understand and maintain.
Here are the general rules for naming variables in C++:
- Names can include letters, digits, and underscores.
- Names must start with either a letter or an underscore (
_). - Names are case-sensitive, meaning
myVarandmyvarwould be considered different variables. - Names must not contain spaces or special characters like
!,#,%, etc. - Reserved keywords in C++ (e.g.,
int) cannot be used as names.
By adhering to these guidelines, you ensure clarity and functionality in your C++ code.