0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

C# 変数と宣言

Last updated at Posted at 2020-05-31

C# 変数

変数とは?
数値や文字などを格納しておく箱のようなもの。
(それに名前を付けた物)

宣言の書き方

宣言方法
2つの変数の宣言 int a; int b; int a,b;
一つの変数の宣言と代入 int a; a = 2; int a= 2;
二つの変数の宣言と代入 int a;int b; a = 1; b = 2;

変数の宣言における命名規則について

(Microsoftからの引用になります!)
フィールド名には Pascal 形式を使用してください。
フィールドの名前には、名詞や名詞句を使用してください。
フィールド名にはプリフィックスを使用しないでください。
たとえば、静的フィールドと非静的フィールドを区別するために、g_ や s_ を使用しないでください

※Pascal形式とは!
・それぞれの単語の頭は大文字
・単語の間に「-(ハイフン)」や「_(アンダースコア)」は使わない

変数の型
・値型と参照型がある
値型
 ・単純型
 ・列挙型
 ・構造体の型
 ・null許容値型
 ・ダブル値型
参照型
 ・クラス型
 ・インターフェイス型
 ・配列型
 ・デリゲート型

※変数の型は別途記載したいと思う。
(各型について調べたが結構量が多い為、細かく分類します)

参考資料
・Microsoft Build
・Wikipedia
・C#の絵本

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?