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. |
auto- Duración automático sin vinculación .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- Duración automático sin vinculación. También alude al compilador para colocar la variable en el registro del procesador .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- Duración estático con el varillaje interno .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- duración estática con cualquiera de enlace interno o externo generalmente más .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- (desde C11) - Hilos duración de almacenamiento .Original:_Thread_local- (desde 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.
Contenido |
[editar] Explicación
[editar] Duración del almacenamiento
Todas las variables de un programa tienen una de las siguientes duraciones de almacenamiento que determina su tiempo de vida:
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.
- ' Automático "duración de almacenamiento. La variable se asigna al comienzo del bloque de código que encierra y desasigna al final. Este es el valor predeterminado para todas las variables, salvo las declaradas
static,externo_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.
- ' Estático' duración de almacenamiento. La variable se asigna cuando el programa comienza y desasigna cuando el programa termina. Sólo una instancia de la variable puede existir. Las variables declaradas con
staticoexterntener este tiempo de almacenamiento .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.
- ' Hilo "duración de almacenamiento (desde C11). La variable se asigna cuando el hilo empieza y desasigna cuando el hilo termina. Cada hilo tiene su propia instancia de la variable. Sólo las variables declaradas
_Thread_localtener este tiempo de almacenamiento._Thread_localsólo puede ser declarada por las variables declaradas constaticoexterny no se puede utilizar en una declaración de función .Original:thread storage duration (desde 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.
- ' Asignado "tiempo de almacenamiento. La variable se asigna y se cancela la asignación por solicitud utilizando funciones asignación de memoria dinámica .Original:allocated storage duration. The variable is allocated and deallocated per request by using asignación de memoria dinámica functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[editar] Vinculación
Varillaje refiere a la capacidad de una variable o función que se hace referencia en los otros ámbitos. Si una variable o función con el mismo identificador se declara en varios ámbitos, pero no se puede hacer referencia a partir de todos ellos, a continuación, varios ejemplos de la variable se generan. Los vínculos se reconocen los siguientes:
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.
- ' Ninguna vinculación ". La variable puede ser denominado sólo del ámbito de aplicación es pulg Todas las variables con duraciones de almacenamiento automático, hilo y dinámica tienen esta vinculación .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.
- ' Vinculación interna ". La variable se puede hacer referencia a partir de todos los ámbitos de la unidad de traducción actual. Todas las variables que se declaran
statictener esta relación .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.
- ' Vínculo externo'. La variable se puede denominar de cualquier otras unidades de traducción en todo el programa. Todas las variables que se declaran bien
externoconstsin explícito almacenamiento especificador de clase, pero nostatic, tienen esta vinculación .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.
[editar] Palabras clave
auto, register, static, extern, _Thread_local
[editar] Ejemplo
| This section is incomplete |