Keywords and Identifiers in C++
Keywords are words the language owns permanently — int, class, if, return, while, and about ninety others — and they can never be reused as names. Identifiers are the names you invent for variables, functions, and classes: they must start with a letter or underscore, followed by letters, digits, or underscores.
C++ is case-sensitive, so score, Score, and SCORE are three different names. Identifiers with a leading underscore followed by a capital letter (like _Foo) are reserved for the implementation — never invent those yourself, or your code can silently collide with compiler internals.
What counts as a keyword
A fixed reserved word such as int, for, class, or new — always meaningful to the compiler, never usable as a variable or function name.
What counts as an identifier
Any name you invent. It must begin with a letter or underscore and contain only letters, digits, and underscores after that.
Case sensitivity
count and Count are completely different identifiers — capitalization is never ignored, so pick one style and stay consistent.
Reserved patterns to avoid
Leading double underscores (__x) and leading underscore plus capital (_X) belong to the compiler and standard library — treat them as off-limits.
#include <iostream> int main() { int player_score = 10; int Player_score = 20; std::cout << player_score << " vs " << Player_score << std::endl; return 0;}Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
Practice what you learned
Re-implement each visualized algorithm in C++ yourself — building beats watching.