Skip to content
Complete List of Keywords in C++
- alignas
- alignof
- and
- and_eq
- asm
- auto
- bitand
- bitor
- bool
- break
- case
- catch
- char
- char8_t
- char16_t
- char32_t
- class
- compl
- const
- constexpr
- constinit
- consteval
- continue
- co_await
- co_return
- co_yield
- decltype
- default
- delete
- do
- double
- dynamic_cast
- else
- enum
- explicit
- export
- extern
- false
- float
- for
- friend
- goto
- if
- inline
- int
- long
- mutable
- namespace
- new
- noexcept
- not
- not_eq
- nullptr
- operator
- or
- or_eq
- private
- protected
- public
- register
- reinterpret_cast
- requires
- return
- short
- signed
- sizeof
- static
- static_assert
- struct
- switch
- template
- this
- thread_local
- throw
- true
- try
- typedef
- typeid
- typename
- union
- unsigned
- using
- virtual
- void
- volatile
- wchar_t
- while
- xor
- xor_eq
C++ Keywords and their Descriptions
- alignas
- Specifies alignment for a type or variable (C++11).
- alignof
- Returns the alignment requirement of a type (C++11).
- and
- Alternative representation for logical AND operator (
&&
).
- and_eq
- Alternative representation for the bitwise AND assignment operator (
&=
).
- asm
- Specifies assembly language instructions (compiler-specific).
- auto
- Specifies that the type of a variable will be automatically deduced (C++11).
- bitand
- Alternative representation for bitwise AND operator (
&
).
- bitor
- Alternative representation for bitwise OR operator (
|
).
- bool
- Defines a boolean type with values
true
and false
.
- break
- Exits from a loop or a switch statement.
- case
- Defines a branch in a switch statement.
- catch
- Catches exceptions thrown by a try block.
- char
- Defines a character data type.
- char8_t
- Defines an 8-bit character type (C++20).
- char16_t
- Defines a 16-bit character type (C++11).
- char32_t
- Defines a 32-bit character type (C++11).
- class
- Declares a class type.
- compl
- Alternative representation for bitwise NOT operator (
~
).
- concept
- Defines a concept for template constraints (C++20).
- const
- Declares a constant variable or specifies that a function parameter or return value cannot be modified.
- consteval
- Specifies immediate evaluation of a constant expression (C++20).
- constexpr
- Specifies that a function or variable can be evaluated at compile time (C++11).
- constinit
- Specifies constant initialization of a variable (C++20).
- continue
- Skips the remaining code in the current loop iteration and proceeds to the next iteration.
- co_await
- Suspends execution until the awaited coroutine completes (C++20).
- co_return
- Returns a value from a coroutine (C++20).
- co_yield
- Yields a value from a coroutine (C++20).
- decltype
- Inspects the declared type of an expression (C++11).
- default
- Specifies the default branch in a switch statement or the default implementation of a special member function.
- delete
- Deallocates memory or disables a function.
- do
- Defines a loop that executes at least once.
- double
- Defines a double-precision floating-point type.
- dynamic_cast
- Safely casts between pointers or references of related types.
- else
- Defines the alternative branch in an if-else statement.
- enum
- Defines an enumeration type.
- explicit
- Specifies that a constructor or conversion function cannot be used implicitly.
- export
- Specifies exported templates or modules (C++20).
- extern
- Specifies that a variable or function has external linkage.
- false
- Boolean constant representing logical
false
.
- float
- Defines a single-precision floating-point type.
- for
- Defines a loop that iterates a specific number of times.
- friend
- Grants access to private and protected members of a class.
- goto
- Transfers control to a labeled statement.
- if
- Defines a conditional branch in the code.
- inline
- Suggests to the compiler to expand the function body at the call site.
- int
- Defines an integer type.
- long
- Defines a long integer type.
- mutable
- Specifies that a member of a constant object can be modified.
- namespace
- Defines a scope for identifiers to avoid name collisions.
- new
- Allocates memory dynamically.
- noexcept
- Specifies that a function does not throw exceptions (C++11).
- not
- Alternative representation of the logical NOT operator (!).
- not_eq
- Alternative representation of the inequality operator (!=).
- nullptr
- Defines a null pointer constant (C++11).
- operator
- Overloads operators for user-defined types.
- or
- Alternative representation of the logical OR operator (||).
- or_eq
- Alternative representation of the bitwise OR assignment operator (|=).
- private
- Defines private access specifiers in a class.
- protected
- Defines protected access specifiers in a class.
- public
- Defines public access specifiers in a class.
- register
- Suggests to the compiler to store a variable in a CPU register.
- reinterpret_cast
- Performs a type conversion that is not checked for safety.
- requires
- Used to define constraints for templates and concepts.
- return
- Returns a value from a function.
- short
- Defines a short integer type.
- signed
- Specifies that a variable is a signed integer.
- sizeof
- Returns the size of a type or variable in bytes.
- static
- Specifies that a variable retains its value between function calls or defines a class-level variable.
- static_assert
- Performs a compile-time assertion (C++11).
- static_cast
- Performs a checked type conversion.
- struct
- Defines a structure type.
- switch
- Defines a multi-way branch statement.
- template
- Defines a template for generic programming.
- this
- Refers to the calling object in a member function.
- thread_local
- Specifies that a variable is local to a thread (C++11).
- throw
- Throws an exception.
- true
- Boolean constant representing logical
true
.
- try
- Defines a block to test for exceptions.
- typedef
- Defines an alias for a type.
- typeid
- Returns runtime type information of an expression.
- typename
- Specifies a type in a template.
- union
- Defines a union type.
- unsigned
- Specifies that a variable is an unsigned integer.
- using
- Imports a namespace or defines an alias for a type (C++11).
- virtual
- Specifies that a function can be overridden in a derived class.
- void
- Specifies that a function does not return a value.
- volatile
- Specifies that a variable can be changed unexpectedly.
- wchar_t
- Defines a wide character type.
- while
- Defines a loop that executes while a condition is true.
- xor
- Alternative representation for the bitwise XOR operator (
^
).
- xor_eq
- Alternative representation for the bitwise XOR assignment operator (
^=
).