C++ is a powerful and versatile programming language, widely used in game development, real-time systems, and embedded firmware. As with any other language, understanding its keywords is crucial for effective coding. So, how many C++ keywords are there? Let's dive into the details.
C++ Keywords: A Brief Overview
C++ keywords are reserved words that have special meanings in the language. They are used to define the structure and semantics of the program. The C++ Standard Library defines a set of keywords that cannot be used as identifiers (like variable or function names).
How Many C++ Keywords Are There?
As of the C++17 standard, there are 95 non-contextual keywords and 32 contextual keywords, making a total of 127 keywords. However, this number can change with each new standard release. For instance, the C++20 standard added 16 new keywords.

Contextual vs Non-Contextual Keywords
C++ keywords can be categorized into two types: contextual and non-contextual.
Non-Contextual Keywords
Non-contextual keywords have a specific meaning in any context. They include keywords like auto, break, case, etc. Here's a list of non-contextual keywords:
alignasalignofandand_eq- ... (other non-contextual keywords)
Contextual Keywords
Contextual keywords can change their meaning based on the context in which they are used. For example, class can be used as a type specifier or as a storage class specifier. Here's a list of contextual keywords:

alignofandand_eq- ... (other contextual keywords)
Reserved Keywords and Identifiers
It's important to note that C++ also reserves certain identifiers that may become keywords in future versions of the standard. These are called reserved keywords. For example, concept was a reserved keyword in C++17 but became a contextual keyword in C++20.
Learning C++ Keywords
Understanding C++ keywords is a crucial part of learning the language. Here are some tips to help you learn them:
- Start with the basics. Learn the non-contextual keywords first, as they have a fixed meaning.
- Understand the context. For contextual keywords, learn their different meanings in different contexts.
- Practice coding. The more you code, the more familiar you'll become with the keywords.
- Use a good reference. The C++ Standard Library documentation is an excellent resource for learning and understanding keywords.
In conclusion, understanding C++ keywords is not just about knowing how many there are, but also about understanding their meanings and uses. This knowledge is essential for writing efficient and effective C++ code.























