Espaces de noms
Variantes
Affichages
Actions

C++ language

De cppreference.com.
< cpp

 
 
Langage C++
Sujets généraux
Contrôle de flux
Instructions conditionnelles
Instructions d'itération
Instructions de saut
Fonctions
déclaration de fonction
expression lambda
fonction générique
spécificateur inline
spécification d'exception (obsolète)
spécificateur noexcept (C++11)
Exceptions
Espaces de noms
Types
spécificateur decltype (C++11)
Qualificatifs
qualificatifs const et volatile
qualificatifs de stockage
qualificatif constexpr (C++11)
qualificatif auto (C++11)
qualificatif alignas (C++11)
Initialisation
Littéraux
Expressions
opérateurs alternatifs
Utilitaires
Types
déclaration typedef
déclaration d'alias de type (C++11)
attributs (C++11)
Jette
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversions implicites
conversion const_cast
conversion static_cast
conversion dynamic_cast
conversion reinterpret_cast
conversions style C et style fonction
Allocation de mémoire
Classes
Qualificatifs spécifiques aux membres de classe
Fonctions membres spéciales
Modèles
classes génériques
fonctions génériques
spécialisation de modèles
paquets de paramètres (C++11)
Divers
Assembleur
 
Il s'agit d'une brève présentation des constructions proposées par le C++.
Original:
This is a brief reference of available C++ language constructs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Les sujets généraux

[modifier] Préprocesseur

[modifier] Commentaires

[modifier] Mots-clés

[modifier] Table ASCII

[modifier] Séquences d'échappement

[modifier] Histoire de C++

[modifier] Contrôle de flux

[modifier] Instructions d'exécution conditionnelle

Les instructions conditionnelles exécutent des chemins de code différents en fonction de la valeur d'une expression donnée.

  • if exécute du code conditionnellement
  • switch exécute le code en fonction de la valeur d'un argument entier

[modifier] Instructions d'itération

Les instructions d'itération exécutent un chemin de code plusieurs fois.

  • for exécute des boucles en spécifiant l'initialisation, la comparaison et l'incrément
  • range-for exécute une boucle sur une plage (depuis C++11)
  • while exécute une boucle, en vérifiant une condition avant chaque itération
  • do-while exécute en boucle, en vérifiant une condition après chaque itération

[modifier] Instructions de saut

Les instructions de saut continuent l'exécution du programme à un autre endroit.

  • continue saute la partie restante du corps de la boucle englobante
  • break termine la boucle qui l'entoure
  • goto continue l'exécution à un autre endroit
  • return termine l'exécution de la fonction englobante

[modifier] Fonctions

Un même code peut être réutilisé à différents endroits dans le programme.

[modifier] Exceptions

Les exceptions sont un moyen plus robuste pour signaler condition d'erreur que les codes de retour des fonctions ou des variables globales d'erreur .
Original:
Exceptions are a more robust way to signal error condition than function return codes or global error variables.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Espaces de noms

Espaces de noms fournissent un moyen d'éviter les conflits de noms dans les grands projets .
Original:
Namespaces provide a way to prevent name clashes in large projects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Types

[modifier] Les prescripteurs

[modifier] Initialisation

Chaque fois qu'une variable nommée est déclarée, et chaque fois qu'un objet temporaire est créé, la valeur initiale du nouvel objet est assurée par l'un des mécanismes suivants:
Original:
Whenever a named variable is declared, and whenever a temporary object is created, the initial value of the new object is provided through one of the following mechanisms:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Littéraux

Les littéraux sont les jetons d'un programme C + + qui représentent des valeurs constantes, intégrées dans le code source .
Original:
Literals are the tokens of a C++ program that represent constant values, embedded in the source code.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Expressions

Une expression est une séquence d'opérateurs et d'opérandes qui spécifient un calcul. Une expression peut se traduire par une valeur et peuvent causer des effets secondaires .
Original:
An expression is a sequence of operators and operands that specifies a computation. An expression can result in a value and can cause side effects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Common operators
affectation incrémentation décrémentation arithmétique logique comparaison accès aux membre autre

a = b
a = rvalue
a += b
a -= b
a *= b
a /= b
a %= b
a &= b
a |= b
a ^= b
a <<= b
a >>= b

++a
--a
a++
a--

+a
-a
a + b
a - b
a * b
a / b
a % b
~a
a & b
a | b
a ^ b
a << b
a >> b

!a
a && b
a || b

a == b
a != b
a < b
a > b
a <= b
a >= b

a[b]
*a
&a
a->b
a.b
a->*b
a.*b

a(...)
a, b
(type) a
? :

Opérateurs spéciaux
static_cast convertit un type à un autre
type compatible
Original:
static_cast converts one type to another compatible type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
dynamic_cast convertit classe de base virtuelle à class
dérivée
Original:
dynamic_cast converts virtual base class to derived class
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
const_cast convertit un type à l'autre compatible avec cv qualifiers
Original:
const_cast converts type to compatible type with different cv qualifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reinterpret_cast convertit type type
incompatibles
Original:
reinterpret_cast converts type to incompatible type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
new alloue memory
Original:
new allocates memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
delete libère memory
Original:
delete deallocates memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
sizeof interroge la taille d'un type
Original:
sizeof queries the size of a type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
sizeof... interroge la taille d'un Paquet de paramètre (depuis C++11)
Original:
sizeof... queries the size of a Paquet de paramètre (depuis C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typeid interroge les informations de type d'une type
Original:
typeid queries the type information of a type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
noexcept vérifie si une expression peut jeter une exception (depuis C++11)
Original:
noexcept checks if an expression can throw an exception (depuis C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
alignof requêtes exigences d'alignement d'un (depuis C++11) type
Original:
alignof queries alignment requirements of a type (depuis C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Utilitaires

Types;
Original:
; Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
, Lance
Original:
; Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
L'allocation de mémoire;
Original:
; Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Classes

Classes fournissent le concept de la programmation orientée objet en C + + .
Original:
Classes provide the concept of object-oriented programming in C++.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Propriétés de la fonction spécifiques à chaque classe

[modifier] Fonctions membres spéciales

[modifier] Modèles

Permet de fonctions et de classes pour fonctionner sur des types génériques
Original:
Allows functions and classes to operate on generic types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Optimisations

[modifier] Divers