Tuesday, June 10, 2014

List Keywords You Can't Use as Variable or Constant Names

Some words are reserved by C++, and you can't use them as variable names or constant names. These keywords have special meaning to the C++ compiler.
asm      else          new                       this
auto     enum        operator                throw
bool     explicit     private                   true
break   export      protected               try
case     extern       public                    typedef
catch    false         register                  typeid
char     float          reinterpret_cast     typename
class    for            return                    union
const   friend        short                     unsigned
goto    signed       const_cast             using
 if        sizeof        virtual                    continue
void    default       inline                     static 
delete  int             static_cast             volatile
do       long          struct                     wchar_t
double mutable    switch                    while
dynamic_cast       namespace            template

No comments:

Post a Comment