Mots clés du C++
Mots clés du C++
Les mots clés communs au C et au C++ sont indiqués en caractères gras.and | and_eq | asm | auto | bitand | bitor |
bool | break | case | catch | char | class |
compl | const | const_cast | continue | default | delete |
do | double | dynamic_cast | else | enum | explicit |
export | extern | false | float | for | friend |
goto | if | inline | int | long | mutable |
namespace | new | not | not_eq | operator | or |
or_eq | private | protected | public | register | reinterpret_cast |
return | short | signed | sizeof | static | static_cast |
struct | switch | template | this | throw | true |
try | typedef | typeid | typename | union | unsigned |
using | virtual | void | volatile | wchar_t | while |
xor | xor_eq | ||||
Le C++ fournit beaucoup plus de mots clés que le langage C. Si un de ces mots clés apparaît comme identificateur dans un programme C, ce programme devra être modifié pour devenir compatible C++.
En C, certains mots clés C++ sont des macros définies dans les en-têtes standard :
and | and_eq | bitand | bitor | compl | not |
not_eq | or | or_eq | wchar_t | xor | xor_eq |
Cela signifie que ces mots clés peuvent être testés en C avec #ifdef, redéfinis, etc.
Le texte original de cette fiche pratique est extrait de
«Tout sur le C++» (Christine EBERHARDT, Collection
CommentCaMarche.net, Dunod, 2009)