Poniższa lista przedstawia słowa kluczowe w C++. Ich znaczenie nie może być w żaden sposób zmienione przez programistę (nie można np. zadeklarować zmiennej o nazwie będącej słowem kluczowym).
| Słowo kluczowe | Opis | |
|---|---|---|
| and | alternatywa dla operatora && | |
| and_eq | alternatywa dla operatora &= | |
| asm | wstawia instrukcje assemblera | |
| auto | deklaruje lokalną zmienną | |
| bool | deklaruje zmienną typu boolean (logiczną) | |
| break | wychodzi z pętli | |
| case | blok kodu w składni switch | |
| catch | obsługa wyjątków rzuconych przez throw | |
| char | deklaracja zmiennej znakowej | |
| class | deklaracja klasy | |
| const | declare immutable data or functions that do not change data | |
| const_cast | rzutowanie ze zmiennej stałej (cast) | |
| continue | przejście do następnej iteracji pętli | |
| default | default handler in a case statement | |
| delete | zwraca pamięć zadeklarowaną dynamicznie | |
| do | konstrukcja pętli | |
| double | declare a double precision floating-point variable | |
| dynamic_cast | dokonuje rzutowania w trakcie działania programu | |
| else | alternatywny blok kodu dla wyrażenia warunkowego if | |
| enum | create enumeration types | |
| explicit | only use constructors when they exactly match | |
| export | allows template definitions to be separated from their declarations | |
| extern | tell the compiler about variables defined elsewhere | |
| false | stała reprezentująca wartość boolean false | |
| float | declare a floating-point variable | |
| for | konstrukcja pętli | |
| friend | grant non-member function access to private data | |
| goto | jump to a different part of the program | |
| if | wywołuje blok kodu na w przypadku prawdziwości testu | |
| inline | optymilizuje wywołanie funkcji | |
| int | deklaracja zmiennej typu całkowitego | |
| long | declare a long integer variable | |
| mutable | override a const variable | |
| namespace | partition the global namespace by defining a scope | |
| new | alokuje dynamicznie pamięć dla nowej zmiennej | |
| operator | tworzy przeciążoną funkcję operatorową | |
| private | deklaruje prywatne pole klasy | |
| protected | deklaruje chronione pole klasy | |
| public | deklaruje publiczne pole klasy | |
| register | request that a variable be optimized for speed | |
| reinterpret_cast | change the type of a variable | |
| return | wyjście z funkcji (i ew. zrócenie wyniku) | |
| short | declare a short integer variable | |
| signed | modify variable type declarations | |
| sizeof | zwraca rozmiar zmiennej lub typu | |
| static | create permanent storage for a variable | |
| static_cast | perform a nonpolymorphic cast | |
| struct | definicja struktury | |
| switch | execute code based on different possible values for a variable | |
| template | tworzy funkcję uogólnioną | |
| this | wskaźnik do obecnego obiektu | |
| throw | throws an exception | |
| true | stała reprezentująca wartość boolean true | |
| try | wykonuje kod, który może wyrzucić wyjątek | |
| typedef | create a new type name from an existing type | |
| typeid | describes an object | |
| typename | declare a class or undefined type | |
| union | a structure that assigns multiple variables to the same memory location | |
| unsigned | declare an unsigned integer variable | |
| using | import complete or partial namespaces into the current scope | |
| virtual | create a function that can be overridden by a derived class | |
| void | declare functions or data with no associated data type | |
| volatile | warn the compiler about variables that can be modified unexpectedly | |
| wchar_t | declare a wide-character variable | |
| while | deklaracja pętli while | |