Reserved words
The syntax rules (or grammar) of C++ define certain symbols to have a unique meaning within a C++ program. These symbols, the reserved words, must not be used for any other purposes. The reserved words already used areint
and void
. All reserved words are in lower-case letters. The table below lists the reserved words of C++.
and
|
and_eq
|
asm
|
|
|
||
bitor
|
bool
|
break
|
|
|
||
char
|
class
|
const
|
|
|
||
default
|
delete
|
do
|
|
|
||
else
|
enum
|
explicit
|
|
|
||
false
|
float
|
for
|
|
|
||
if
|
inline
|
int
|
|
|
||
namespace
|
new
|
not
|
|
|
||
or
|
or_eq
|
private
|
|
|
||
register
|
reinterpret_cast
|
return
|
|
|
||
sizeof
|
static
|
static_cast
|
|
|
||
template
|
this
|
throw
|
|
|
||
typedef
|
typeid
|
typename
|
|
|
||
using
|
virtual
|
void
|
|
|
||
while
|
xor
|
xor_eq
|
||||
auto
|
bitand
|
|||||
case
|
catch
|
|||||
const_cast
|
continue
|
|||||
double
|
dynamic_cast
|
|||||
export
|
extern
|
|||||
friend
|
goto
|
|||||
long
|
mutable
|
|||||
not_eq
|
operator
|
|||||
protected
|
public
|
|||||
short
|
signed
|
|||||
struct
|
switch
|
|||||
true
|
try
|
|||||
union
|
unsigned
|
|||||
volatile
|
wchar_t
|
|||||
near
, far
, huge
, cdecl
, and pascal
.Notice that
main
is not a reserved word. However, this is a fairly technical distinction, and for practical purposes you are advised to treat main
, cin
, and cout
as if they were reserved as well.
0 Questions:
Post a Comment