Storage-class specifiers
Aus 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
- automatischer ohne Bindung .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
- automatischer ohne Bindung. Auch Hinweise für den Compiler, um die Variable in der Prozessor-Register legen .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
- statische Dauer mit interner Bindung .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
- statische Dauer mit internen oder häufiger externe Bindung .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
- (Seit C11) - Gewinde Lagerdauer .Original:_Thread_local
- (Seit 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.
Inhaltsverzeichnis |
[Bearbeiten] Erklärung
[Bearbeiten] Lagerdauer
Alle Variablen in einem Programm eine der folgenden Speicher-Dauer, die die Lebensdauer bestimmt:
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.
- ' 'Automatische Lagerdauer. Die Variable wird zu Beginn des einschließenden Codeblock reserviert und freigegeben am Ende. Dies ist die Standardeinstellung für alle Variablen, mit Ausnahme deklariert
static
,extern
oder_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
,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.
- ' 'Static Lagerdauer. Die Variable zugeordnet wird, wenn das Programm beginnt und freigegeben, wenn das Programm beendet. Nur eine Instanz des variablen existieren kann. Deklarierten Variablen mit
static
oderextern
haben diese Lagerdauer .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 withstatic
orextern
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.
- ' 'Thread Lagerdauer (Seit C11). Die Variable zugeordnet wird, wenn der Faden beginnt und freigegeben, wenn der Thread beendet. Jeder Thread hat eine eigene Instanz der Variable. Nur Variablen deklariert
_Thread_local
haben diese Lagerdauer._Thread_local
kann nur für Variablen deklariert mit erklärt werdenstatic
oderextern
und kann nicht in einer Funktion Deklaration verwendet werden .Original:thread storage duration (Seit 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 withstatic
orextern
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.
- ' 'Zugeordneten Lagerdauer. Die Variable wird reserviert und freigegeben pro Anforderung mithilfe dynamische Speicherverwaltung Funktionen .Original:allocated storage duration. The variable is allocated and deallocated per request by using dynamische Speicherverwaltung functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Linkage
Bindung bezieht sich auf die Fähigkeit einer Variable oder Funktion in anderen Bereichen bezeichnet. Wenn eine Variable oder Funktion mit dem gleichen Bezeichner in mehreren Bereichen deklariert wird, aber nicht, um aus allen von ihnen bezeichnet werden, werden dann mehrere Instanzen des variablen erzeugt. Die folgenden Verbindungen werden erkannt:
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.
- ' 'Keine Verknüpfung. Die Variable kann nur vom Umfang bezeichnet ist es in. Alle Variablen mit automatischer, Faden und dynamischen Speichermodul Dauern haben diese Bindung .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.
- ' 'Interne Bindung. Die Variable kann von allen Bereiche in der aktuellen Übersetzungseinheit bezeichnet werden. Alle Variablen, die
static
deklariert haben diese Verbindung .Original:internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables which are declaredstatic
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.
- ' 'Externe Bindung. Die Variable kann von allen anderen Übersetzungseinheiten im gesamten Programm bezeichnet werden. Alle Variablen, die entweder
extern
oderconst
ohne explizite Storage-Klasse Spezifizierer deklariert sind, aber nichtstatic
haben diese Verbindung .Original:external linkage. The variable can be referred to from any other translation units in the entire program. All variables which are declared eitherextern
orconst
with 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.
[Bearbeiten] Keywords
auto, register, static, extern, _Thread_local
[Bearbeiten] Beispiel
This section is incomplete |