H.A.2.1 o Reserved Words

RESERVED WORDS IN C++

 

 

Keyword                 Contextual Description

 

asm                          Declares information to be passed directly to the assembler

auto                          Declares objects whose lifetime is the duration of control within their block

break                       Terminates processing of a switch statement or loop

case                         Used in a switch statement to specify a match for the statement's expression

catch                        Used to specify the actions to be taken when an exception occurs (see throw, try)

char                         Declares objects whose values are characters

class                        Construct new types to describe data and operations (default private)

const                        Declares constants

continue                  Used in a loop statement to transfer control to the beginning of the loop

default                     Used in a switch statement to handle expression values not specified using case

delete                       Deallocates memory allocated at run-time, returning it to the memory heap

do                             Marks the beginning of a do-while statement

double                      Declares objects whose values are double precision real numbers

else                          Used as the alternative action of an if statement

enum                       Used to declare a type whose values are defined by the programmer

extern                      Declares objects whose definitions are external to the local block

float                         Declares objects whose values are single precision real numbers

for                            Marks the beginning of a for statement

friend                      Declares class operations that are not member functions

goto                          Transfers control to a label

if                               Marks the beginning of an if statement

inline                       Declares a function whose text is to be substituted for its call

int                            Declares objects whose values are integer numbers

long                         Used to declare 32-bit (4 byte) integer or extended double precision real numbers

new                          Allocates memory dynamically at run-time

operator                  Used to overload an operator with a new declaration

private                     Declares class members that are inaccessible from outside of the class

protected                 Declares class members that are private, except to derived classes

public                      Declares class members that can be accessed outside of the class

register                  Declares objects whose values are to be kept in CPU registers

return                     Terminates a function, usually returning the value of some expression

short                        Used to declare 16-bit integer numbers

signed                     Used to declare an object in which the value's sign is stored in the high-order bit

sizeof                       Finds the size (in bytes) of an object or of the representation of a type

static                       Declares objects whose lifetime is the duration of the program

struct                      Used to construct new types consisting of data and operations (default public)

switch                      Marks the beginning of a switch statement

template                  Used to declare type-independent classes or functions

this                          Used with a class member to unambiguously access other members of the class

throw                       Used to generate an exception (see catch, try)

try                            Used to mark the beginning of a block containing exception handlers (see catch)

typedef                     Used to declare a name as a synonym for an existing type

union                       Used to declare a structure, such that different objects can have different members

unsigned                 Declares an object in which the high-order bit is used for data (see signed)

virtual                     Used to declare a base-class function, that will be defined by a derived class

void                          Used to indicate the absence of any type (for a function or parameter list)

volatile                    Used to declare objects whose values may be modified by means undetectable to the compiler (such as shared memory objects of concurrent processes)

while                        Marks the beginning of a while statement, as well as the end of a do-while statement