Storage duration specifiers
提供: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- 自動記憶期間。 (廃止予定)Original:auto- automatic storage duration. (廃止予定)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.register- 自動記憶期間。また、プロセッサのレジスタに変数を配置するために、コンパイラにヒント。 (廃止予定)Original:register- automatic storage duration. 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- '静的記憶域期間と'内部リンケージOriginal: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- '静的記憶域期間と'外部リンケージOriginal: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- スレッド記憶域期間。 (C + + 11以来)Original:thread_local- thread storage duration. (C + + 11以来)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 説明
[編集] 記憶期間
プログラム内のすべての変数は、次の記憶域期間のいずれかを持っている
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.
- ' '自動記憶域期間。変数は、囲んでいるコードブロックの先頭に割り当てられ、端に割り当て解除されます。すべての非大域変数は宣言
static、externまたはthread_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.
- ' '静的記憶域期間。変数はプログラムの開始時に割り当てられたプログラムが終了すると、割り当てが解除されます。唯一の変数のインスタンスが1つ存在します。すべてのグローバル変数はこの記憶域期間を持つ、プラスのものは
staticまたはexternで宣言された.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.
- ' 'スレッド記憶域期間(C + + 11以来)。変数は、スレッドの開始時に割り当てられ、スレッドが終了するときに解放されています。各スレッドは、変数の独自のインスタンスを持っています。唯一の変数は
thread_localこの記憶域期間を持つと宣言した。thread_localは、グローバル変数の宣言に加えて、それらはstaticまたはexternを使用して宣言することができます.Original:thread storage duration (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.
- ' 'ダイナミック記憶域期間。変数は動的メモリ割り当て機能を使用することによって割り当てられ、要求ごとに割り振り解除され.Original:dynamic storage duration. The variable is allocated and deallocated per request by using 動的メモリ割り当て functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[編集] リンケージ
リンケージは、別のスコープで参照される変数や関数の機能を指します。同じ識別子を持つ変数や関数が複数のスコープで宣言されているが、それらのすべてから参照できない場合は、変数の後、いくつかのインスタンスが生成されます。次の結合が認識されます
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.
- ' 'ノーリンケージ。変数は、それがこのリンケージを持つインチ自動、スレッドとダイナミック記憶域期間を持つすべての変数にのみスコープから参照することができます.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.
- ' '内部リンケージ。変数は、現在の翻訳単位内のすべてのスコープから参照することができます。どちら
static、またはconstを宣言しなくexternれる静的記憶域期間を持つすべての変数は、このリンケージを持つ.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.
- ' '外部リンケージ。変数は、他の翻訳単位内のスコープから参照することができます。静的記憶域期間を持つすべての変数は、それらの宣言
static、またはconstを除いて、このリンケージを持たなくextern.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.
[編集] キーワード
auto, register, static, extern, thread_local
[編集] 例
| This section is incomplete |