Storage-class specifiers
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
auto- durée automatique sans lien .Original:auto- automatic duration with no linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.register- durée automatique sans lien. Indique également au compilateur de placer la variable dans le registre du processeur .Original:register- automatic duration with no linkage. Also hints to the compiler to place the variable in the processor's register.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.static- durée statique avec une liaison interne .Original:static- static duration with internal linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.extern- durée statique soit avec une liaison interne ou plus généralement externe .Original:extern- static duration with either internal or more usually external linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions._Thread_local- (depuis C11) - durée de stockage de fil .Original:_Thread_local- (depuis C11) - thread storage duration.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explication
Durée de stockage
Toutes les variables dans un programme de prendre l'une des durées de stockage suivants qui détermine sa durée de vie:
Original:
All variables in a program have one of the following storage durations that determines its lifetime:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- ' Automatique "durée de stockage. La variable est attribuée au début du bloc de code et enfermant libérée à la fin. Ceci est la valeur par défaut pour toutes les variables, sauf celles qui sont déclarées
static,externou_Thread_local.Original:automatic storage duration. The variable is allocated at the beginning of the enclosing code block and deallocated at the end. This is the default for all variables, except those declaredstatic,externor_Thread_local.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' Statique "durée de stockage. La variable est allouée lorsque le programme commence et libéré lorsque le programme se termine. Une seule instance de la variable peut exister. Les variables déclarées avec
staticouexternavoir cette durée de stockage .Original:static storage duration. The variable is allocated when the program begins and deallocated when the program ends. Only one instance of the variable can exist. Variables declared withstaticorexternhave this storage duration.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' Filetage (depuis C11) durée de stockage. La variable est allouée lorsque le thread commence et libérée lorsque le thread se termine. Chaque thread possède sa propre instance de la variable. Seules les variables déclarées
_Thread_localavoir cette durée de stockage._Thread_localne peut être déclarée pour les variables déclarées avecstaticouexternet ne peut pas être utilisé dans une déclaration de fonction .Original:thread storage duration (depuis C11). The variable is allocated when the thread begins and deallocated when the thread ends. Each thread has its own instance of the variable. Only variables declared_Thread_localhave this storage duration._Thread_localcan only be declared for variables declared withstaticorexternand cannot be used in a function declaration.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' Alloué "durée de stockage. La variable est allouée et libérée par la demande en utilisant des fonctions allocation dynamique de mémoire .Original:allocated storage duration. The variable is allocated and deallocated per request by using allocation dynamique de mémoire functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Liaison
Lien renvoie à la capacité d'une variable ou une fonction à être mentionné dans les autres étendues. Si une variable ou une fonction avec le même identifiant est déclaré dans plusieurs étendues, mais ne peut pas être appelé à partir de chacun d'eux, puis plusieurs instances de la variable sont générés. Les liens suivants sont reconnus:
Original:
Linkage refers to the ability of a variable or function to be referred to in other scopes. If a variable or function with the same identifier is declared in several scopes, but cannot be referred to from all of them, then several instances of the variable are generated. The following linkages are recognized:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- ' Aucun lien ». La variable peut être évoquée que de la portée, il est po Toutes les variables avec des durées de stockage automatique, filetage et dynamique ont ce lien .Original:no linkage. The variable can be referred to only from the scope it is in. All variables with automatic, thread and dynamic storage durations have this linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' Couplage interne ». La variable peut être appelée à partir de tous les champs d'application dans l'unité de traduction en cours. Toutes les variables qui sont déclarées
staticavoir ce lien .Original:internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables which are declaredstatichave this linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' Externe lien. La variable peut être appelé à partir de toutes les unités de traduction dans d'autres la totalité du programme. Toutes les variables qui sont déclarées soit
externouconstsans explicite de stockage spécificateur de classe, mais passtatic, ont ce lien .Original:external linkage. The variable can be referred to from any other translation units in the entire program. All variables which are declared eitherexternorconstwith no explicit storage-class specifier, but notstatic, have this linkage.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Mots-clés
auto, register, static, extern, _Thread_local
Exemple
| This section is incomplete |