When you write a program in C++, you are essentially having a conversation with the computer. To make sure the computer understands you, the language uses a specific set of “reserved words” known as C++ keywords. These are the “VIPs” of the language, they have special jobs that no other word can do.
For example, when you use int, the compiler immediately knows you are talking about a whole number. If you tried to name a variable int, the computer would get confused, like trying to name a person “Human.”
Understanding the c++ keywords list with explanation is fundamental for any student moving from basic scripts to professional software development.
What are C++ Keywords?
C++ Keywords are the smallest individual units of the language, often called “tokens.” They are always written in lowercase and have a fixed meaning. Because they are part of the language’s internal structure, you cannot use them as identifiers (names for variables, classes, or functions).
Why Do They Matter?
- Syntax Definition: They define the structure of your code (e.g., if, for, while).
- Data Typing: They tell the computer how much memory to set aside (e.g., double, char, bool).
- Access Control: They decide who can see your data (e.g., public, private).
C++ Keywords List with Explanation
While there are many keywords, here are the most essential ones grouped by their function.
-
Data Type Keywords
These define what kind of data a variable can store.
- int: Stores whole numbers (integers).
- float: Stores numbers with decimals (single precision).
- double: Stores large numbers with decimals (double precision).
- char: Stores a single character (like ‘A’ or ‘$’).
- bool: Stores a true or false value.
-
Control Flow Keywords
These decide the “path” your code takes.
- if / else: Used for making decisions.
- switch / case: Handles multiple conditions in a cleaner way.
- for / while / do: Used to create loops that repeat tasks.
- break / continue: Controls the behavior inside a loop.
-
Object-Oriented Keywords
These are the backbone of C++’s power.
- class / struct: Used to create custom data types.
- public / private / protected: Access specifiers for class members.
- virtual: Used to support polymorphism (advanced function behavior).
- this: A pointer that refers to the current object.
-
Memory and Exception Keywords
- new / delete: Used for dynamic memory management.
- try / catch / throw: Used for handling errors (exceptions).
C++ Keywords Total and Evolution
The c++ keywords total has grown as the language evolved to handle more complex modern tasks.
| C++ Version | Approximate Total Keywords | Notable Additions |
| C++98 | 63 | bool, class, template |
| C++11 | 73 | auto, nullptr, static_assert |
| C++20 | 95 | concept, requires, co_await |
| C++26 (Future) | ~97+ | contract_assert, pre, post |
Downloading the C++ Keywords List
If you are looking for a c++ keywords list pdf, many students find it helpful to keep a printed copy near their desk. A standard PDF guide will typically list the keywords alphabetically alongside a one-line description. This is an excellent way to avoid “Reserved Word” errors while you are coding.
C++ Topics
🔹 C / C++ Introduction & Fundamentals |
🔹 C / C++ Syntax, Variables & Data Types |
🔹 Operators & Control Flow |
🔹 Loops & Iteration |
🔹 Functions & Recursion |
🔹 Arrays, Strings & Pointers |
🔹 Structures, Unions & Enums |
🔹 Object-Oriented Programming (C++) |
🔹 STL, Libraries & Header Files |
🔹 C / C++ Programs & Practice |
🔹 Interviews, Jobs & Career |
🔹 Comparisons & Differences |
🔹 Other / Unclassified C / C++ Topics |
FAQs
Can I use a keyword as a variable name if I capitalize it?
Yes, because C++ is case-sensitive, Int is technically different from int. However, this is considered very bad practice because it makes your code confusing for other people to read.
What happens if I use a keyword as an identifier?
Your compiler will likely say "Expected an identifier" or "Conflict with reserved word."" You need to update the name of your program before it will execute.
Why does C++ have more keywords than C?
C++ is a newer version of C. It adds a lot of new terminology for "Object-Oriented Programming" (like class and buddy) and "Generic Programming" (like template).
What is the "auto" keyword used for?
In current C++, auto directs the compiler to figure out the data type on its own depending on the value you give it. For instance, auto x = 5; will set x to be an int.
