Storage duration 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-' duração de armazenamento automático. (obsoleta)Original:auto- automatic storage duration. (obsoleta)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.register-' duração de armazenamento automático. Também indica para o compilador para colocar a variável no registo do processador. (obsoleta)Original:register- automatic storage duration. Also hints to the compiler to place the variable in the processor's register. (obsoleta)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.static- duração de armazenagem estática e interna ligaçãoOriginal:static- static storage duration and internal linkageThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.extern- duração de armazenagem estática e' ligação externaOriginal:extern- static storage duration and external linkageThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.thread_local-' fio duração de armazenamento. (desde C++11)Original:thread_local- thread storage duration. (desde C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explicação
Tempo de armazenamento
Todas as variáveis em um programa de ter uma das seguintes durações de armazenagem:
Original:
All variables in a program have one of the following storage durations:
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 duração de armazenamento. A variável é atribuído no início do bloco de código colocando e desalocadas no final. Todas as variáveis não-globais tem esse tempo de armazenamento, exceto os declarados
static,externouthread_local.Original:automatic storage duration. The variable is allocated at the beginning of the enclosing code block and deallocated on end. All non-global variables have this storage duration, except those declaredstatic,externorthread_local.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' 'Estática tempo de armazenamento. A variável é atribuído quando o programa começa e desalocado quando o programa termina. Apenas uma instância da variável existe. Todas as variáveis globais tem esse tempo de armazenamento, além de declarados com
staticouextern.Original:static storage duration. The variable is allocated when the program begins and deallocated when the program ends. Only one instance of the variable exists. All global variables have this storage duration, plus those declared withstaticorextern.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' 'Rosca tempo de armazenamento (desde C++11). A variável é atribuído quando a linha começa e desalocado quando a thread terminar. Cada segmento tem sua própria instância da variável. Apenas variáveis declarou
thread_localter este tempo de armazenamento.thread_localsó pode ser declarada para variáveis globais, mais aqueles declarados comstaticouextern.Original:thread storage duration (desde C++11). 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 declaredthread_localhave this storage duration.thread_localcan only be declared for global variables, plus those declared withstaticorextern.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- ' 'Dinâmico duração de armazenamento. A variável é alocado e desalocado por solicitação usando funções alocação dinâmica de memória.Original:dynamic storage duration. The variable is allocated and deallocated per request by using alocação dinâmica de memória functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ligação
Linkage refere-se à capacidade de uma variável ou função a ser referido em outros âmbitos. Se uma variável ou função com o mesmo identificador é declarado em vários âmbitos, mas não pode ser referido de todos eles, em seguida, várias instâncias da variável são gerados. As ligações seguintes são reconhecidos:
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.
- ' 'Nenhuma ligação. A variável pode ser referida apenas do âmbito que está dentro Todas as variáveis com tempos de armazenamento de rosca, automático e dinâmico tem essa ligação.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.
- ' 'Interna ligação. A variável pode ser referido de todos os âmbitos da actual unidade de tradução. Todas as variáveis com duração de armazenagem estática que são ou declarados
static, ouconstmas nãoextern, têm essa ligação.Original:internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables with static storage duration which are either declaredstatic, orconstbut notextern, 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.
- ' 'Externa ligação. A variável pode ser referida a partir dos âmbitos em unidades de tradução outros. Todas as variáveis com duração de armazenagem estática tem essa ligação, exceto aqueles
staticdeclarado, ouconstmas nãoextern.Original:external linkage. The variable can be referred to from the scopes in the other translation units. All variables with static storage duration have this linkage, except those declaredstatic, orconstbut notextern.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Palavras-chave
auto, register, static, extern, thread_local
Exemplo
| Esta seção está incompleta |