C++ Keywords

C++ provides a wide range of Keywords and much extensive than C programming offers. Below are the commonly used Keywords (reserved).

alignasUsed to precisely control the memory alignment of a user defined data/variable
alignofreturns in the alignment value in bytes of the specified type
andbitwise AND operator
and_eqequivalent to &= operator
__asmused to invoke an assembly level insrtruction right after it
autoused to declare a variable who type is sometime difficult to be stated
bitandthe bitwise AND operator
bit orthe bitwise OR operator
boolboolean data type
breakends execution of nearest loop or condtional statement
caseenables to define code sections based on condition
catchused to implement exception handling usig try .. Catch
charbuilt in type to represent a character data. Variiations include char8_t, char16_t, char32_t
classdefines a class type or an object of a class type
complused as the bitwise complement ~ operator which will turn 1s to 0’s in the return
constto define a variable that not modifiable
const_castremoves the const, volatile and unaligned attributes from a class
const_exprconstant expression
continuenormally used in loops / conditional to transfer control to the controlling expression of the enclosing of the smallest enclosing 
decltypeyeilds the type of a specified expression
defaultallows to define default code section in a case statement
deleteused to deallocate a block of memory pointed by a cast operation via a pointer
doused to create a looping construct as in do …. While
doublethe built in type for representing floating point numbers that are >= float and less than ‘long’ data typed numbers
dynamic_castused to convert an expression to a specified type
elseused to implement the else part as in if .. Else loop
enumused to define a set of named integral constants/enumerators
explicitused to force an explicit cast operation
externas applied to a global variable to denote that it has an external linkage
FALSEone of the values of a boolean variable
floatthe built in type for representing floating point numbers
forused for building looping constructs
friendused to define another class as a friend within a class so that the friend class can access its members
gotoused to unconditionally transfer program control to the specified label
ifused to implement conditional constructs
inlineused 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
intthe built in type for representing integers
longthe built in type for representing floating point numbers that are >= double 
mutableused to define a nonstatic and noncasted member so its value can be changed from a constant member function. 
namespaceused to organize code into similar logical groups
newused to instantiate a class type as an object so memmory is allocated to it
noexceptused to define if a function does not throw an exception. Used to optimize compiler determinations.
notbitwise NOT operator
not__eqbitwise not equal to operator
nullptrused to specify an explicit null pointer constant
operatorused for explicit ‘operator’ overloading 
orthe bitwise OR operator
or_eqbitwise OR Equal to operator
privateused to restrcit accces to only class members
protectedused to provide access to class members for derived/friend classes
publicused to make members accessible/exposed to public usage
reinterpret_castused to convert a poinnter type to another 
returnreturns control to the calling functions or piece of code
shortsmall integers in range  −32,767 to +32,767 
signedthat can hold both positive and negative numbers
sizeofused to find size of eg: char
staticused in scenarios when one copy of the member is shared by all instances of the class
static_castUsed to convert an expression to a specified type eg: converting enum type to int
structdefines a struct type
switchused to implement conditional constructs along with case
templateused to implement generic types
thispoints to the current object in scope
thread_localto make sure that the variable declared on a thread is available only on that thread.
throwused to throw exception in try – catch exception handling 
TRUEthe true value of the bool type
trytry part of the try catch exception handling 
typedefused to create an additional name for a data type
typeidallows to find the type of an object at runtime
Typenameis used while creating generic type to mention that a depedent name in a template is another type
unionis a use defined type where all members will share the same memory location
unsignedthat can hold numbers without signs
usingUsing-declaration introduces a member of another namespace into current namespace or block scope See namespacefor details.
virtualused to define base functions which can be overriden by the child class
voiddata type when a function returns nothing
volatiledata type used to declare a variable that can be modfied by a hardware
wchar_tis the wide char / muti byte version of char
whileused to implement the while looping construct
xorbit exclusive OR operator
xor_eqbit exclusive OR Equal to operator

Add a Comment

Your email address will not be published. Required fields are marked *