Espacios de nombres
Variantes
Acciones

Storage-class specifiers

De cppreference.com
< c‎ | language

 
 
Lenguaje C
Los temas generales
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Preprocessor
Comentarios
Palabras clave
Tabla ASCII
Las secuencias de escape
Historia de C
Control de flujo
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sentencias condicionales ejecución
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Instrucciones de iteración
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ir declaraciones
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaración de la función
especificador inline
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los especificadores
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv especificadores
especificadores de clase de almacenamiento
alignas especificador (C99)
Los literales
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expresiones
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
orden de evaluación
los operadores alternativos
los operadores
prioridad de los operadores
Utilidades
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
atributos (C99)
proyecta
Varios
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Montaje en línea
 
  • 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.
  • ' 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, extern o _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 declared static, extern or _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 static o extern tener 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 with static or extern have 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_local tener este tiempo de almacenamiento. _Thread_local sólo puede ser declarada por las variables declaradas con static o extern y 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_local have this storage duration. _Thread_local can only be declared for variables declared with static or extern and 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.
  • ' 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 static tener esta relación .
    Original:
    internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables which are declared static 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.
  • ' 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 extern o const sin explícito almacenamiento especificador de clase, pero no static, 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 either extern or const with no explicit storage-class specifier, but not static, 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