Beruflich Dokumente
Kultur Dokumente
some books it was mentioned that Reserved words are also called as
Reserved Keywords and some authors will use keyword in the same
sense that we have used Reserved word.
Infact all keywords are subset of Reserve words.
Keywords can be redefined while Reserved words cannot be
redefined and used.
Forexample:
#include<iostream>
using namespace std;
int main()
{
int main;
// it can be redefined
main = 1;
cout<< main;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int auto;
auto = 1;
cout<< auto;
return 0;
}
HereisalistofReservedwordsandkeywords.
C++ Rerserved words :
The reserved words of C++ may be conveniently placed into 3
groups. In the first group we put those that were also present in the C
programming language and have been carried over into C++. There are
32 of these, and here they are:
auto
const
double
float
int
short
struct
unsigned
break
continue
else
for
long
signed
switch
void
case
default
enum
goto
register
sizeof
typedef
volatile
char
do
extern
if
return
static
union
while
dynamic_cast
bool
explicit
namespace
reinterpret_cast
try
export
new
static_cast
typeid
catch
false
operator
template
using
class
friend
private
this
typename
const_cast inline
public
throw
virtual
delete
protected
true
wchar_t
mutable
and
bitand
compl
not_eq
or_eq
and_eq
bitor
not
or
xor
xor_eq
Predefined Identifiers :
Here is a very short list of some of the predefined identifiers :
cin
cout
endl
include
INT_MIN
INT_MAX
iomanip main
iostream MAX_RAND
npos
NULL
std
string