名前空間
変種
操作

Storage-class specifiers

提供: cppreference.com
< c‎ | language

 
 
C言語
一般的なトピック
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.
プリプロセッサ
コメント
キーワード
ASCIIチャート
エスケープシーケンスを
C
フロー制御
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.
条件付き実行文
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.
繰り返し文
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.
文をジャンプします
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.
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
関数の宣言
の歴史。インライン指定
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
指定子
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指定
記憶クラス指定子
alignas指定子 (C99)
リテラル
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
評価の順序
代替演算子
演算子
演算子の優先順位
ユーティリティ
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
属性 (C99)
キャストします
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
インラインアセンブリ
 
  • autoは - noリンケージを持つ自動持続.
    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は - noリンケージを持つ自動持続。また、プロセッサのレジスタに変数を配置するようにコンパイラへのヒント.
    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 - 内部リンケージを持つ静的期間.
    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 - 内部またはより一般的には外部リンケージを持つ静的期間.
    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 - (C11以来) - スレッドストレージ期間.
    Original:
    _Thread_local - (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.

目次

[編集] 説明

[編集] 記憶期間

プログラム内のすべての変数は、その存続期間を決定し、次の記憶域期間のいずれかを持っている
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.
  • ' '自動記憶域期間。変数は、囲んでいるコードブロックの先頭に割り当てられ、終了時に割り当て解除されます。これは、すべての変数のデフォルトである、宣言されたものを除くstaticexternまたは_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.
  • ' '静的記憶域期間。変数はプログラムの開始時に割り当てられたプログラムが終了すると、割り当てが解除されます。変数のインスタンスだけが存在することができます。変数は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 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.
  • ' 'スレッド記憶域期間(C11以来)。変数は、スレッドの開始時に割り当てられ、スレッドが終了するときに解放されています。各スレッドは、変数の独自のインスタンスを持っています。唯一の変数は_Thread_localこの記憶域期間を持つと宣言した。 _Thread_localだけで宣言した変数を宣言することができ、staticまたはexternと関数の宣言で使用することはできません.
    Original:
    thread storage duration (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.
  • ' '割り当てられた記憶域期間。変数は動的メモリ割り当て機能を使用することによって割り当てられ、要求ごとに割り振り解除され.
    Original:
    allocated 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.
  • ' 'ノーリンケージ。変数は、それがこのリンケージを持つインチ自動、スレッドとダイナミック記憶域期間を持つすべての変数にのみスコープから参照することができます.
    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宣言された変数はすべて、このリンケージを持つ.
    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.
  • ' '外部リンケージ。変数はプログラム全体の任意の他の翻訳単位から参照することができます。明示的な記憶域クラス指定子を持つexternまたはconstのいずれかで宣言ではなく、staticされているすべての変数は、このリンケージを持つ.
    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.

[編集] キーワード

auto, register, static, extern, _Thread_local

[編集]