C++ Keywords
January 15, 2021
C++ provides a wide range of Keywords and much extensive than C programming offers. Below are the commonly used Keywords (reserved).
| alignas | Used to precisely control the memory alignment of a user defined data/variable |
| alignof | returns in the alignment value in bytes of the specified type |
| and | bitwise AND operator |
| and_eq | equivalent to &= operator |
| __asm | used to invoke an assembly level insrtruction right after it |
| auto | used to declare a variable who type is sometime difficult to be stated |
| bitand | the bitwise AND operator |
| bit or | the bitwise OR operator |
| bool | boolean data type |
| break | ends execution of nearest loop or condtional statement |
| case | enables to define code sections based on condition |
| catch | used to implement exception handling usig try .. Catch |
| char | built in type to represent a character data. Variiations include char8_t, char16_t, char32_t |
| class | defines a class type or an object of a class type |
| compl | used as the bitwise complement ~ operator which will turn 1s to 0’s in the return |
| const | to define a variable that not modifiable |
| const_cast | removes the const, volatile and unaligned attributes from a class |
| const_expr | constant expression |
| continue | normally used in loops / conditional to transfer control to the controlling expression of the enclosing of the smallest enclosing |
| decltype | yeilds the type of a specified expression |
| default | allows to define default code section in a case statement |
| delete | used to deallocate a block of memory pointed by a cast operation via a pointer |
| do | used to create a looping construct as in do …. While |
| double | the built in type for representing floating point numbers that are >= float and less than ‘long’ data typed numbers |
| dynamic_cast | used to convert an expression to a specified type |
| else | used to implement the else part as in if .. Else loop |
| enum | used to define a set of named integral constants/enumerators |
| explicit | used to force an explicit cast operation |
| extern | as applied to a global variable to denote that it has an external linkage |
| FALSE | one of the values of a boolean variable |
| float | the built in type for representing floating point numbers |
| for | used for building looping constructs |
| friend | used to define another class as a friend within a class so that the friend class can access its members |
| goto | used to unconditionally transfer program control to the specified label |
| if | used to implement conditional constructs |
| inline | used to define class methods/function outside as if they were instantiated funcitons more often to improve program performance as related to function calling during compile time |
| int | the built in type for representing integers |
| long | the built in type for representing floating point numbers that are >= double |
| mutable | used to define a nonstatic and noncasted member so its value can be changed from a constant member function. |
| namespace | used to organize code into similar logical groups |
| new | used to instantiate a class type as an object so memmory is allocated to it |
| noexcept | used to define if a function does not throw an exception. Used to optimize compiler determinations. |
| not | bitwise NOT operator |
| not__eq | bitwise not equal to operator |
| nullptr | used to specify an explicit null pointer constant |
| operator | used for explicit ‘operator’ overloading |
| or | the bitwise OR operator |
| or_eq | bitwise OR Equal to operator |
| private | used to restrcit accces to only class members |
| protected | used to provide access to class members for derived/friend classes |
| public | used to make members accessible/exposed to public usage |
| reinterpret_cast | used to convert a poinnter type to another |
| return | returns control to the calling functions or piece of code |
| short | small integers in range −32,767 to +32,767 |
| signed | that can hold both positive and negative numbers |
| sizeof | used to find size of eg: char |
| static | used in scenarios when one copy of the member is shared by all instances of the class |
| static_cast | Used to convert an expression to a specified type eg: converting enum type to int |
| struct | defines a struct type |
| switch | used to implement conditional constructs along with case |
| template | used to implement generic types |
| this | points to the current object in scope |
| thread_local | to make sure that the variable declared on a thread is available only on that thread. |
| throw | used to throw exception in try – catch exception handling |
| TRUE | the true value of the bool type |
| try | try part of the try catch exception handling |
| typedef | used to create an additional name for a data type |
| typeid | allows to find the type of an object at runtime |
| Typename | is used while creating generic type to mention that a depedent name in a template is another type |
| union | is a use defined type where all members will share the same memory location |
| unsigned | that can hold numbers without signs |
| using | Using-declaration introduces a member of another namespace into current namespace or block scope See namespacefor details. |
| virtual | used to define base functions which can be overriden by the child class |
| void | data type when a function returns nothing |
| volatile | data type used to declare a variable that can be modfied by a hardware |
| wchar_t | is the wide char / muti byte version of char |
| while | used to implement the while looping construct |
| xor | bit exclusive OR operator |
| xor_eq | bit exclusive OR Equal to operator |