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?

C#備忘録

Posted at

業務でいきなりC#を触ることになったため
基礎の基礎の部分を備忘録程度に残す

using System; /*標準ライブラリ仕様の宣言*/

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("HelloWorld!"); /*コンソールに文字出力*/
    }
}

上記がいわゆる基礎の基礎(どこのページ見てもこの書き方をしている)
になる
Using System;はシステムライブラリ内のメソッドをSystemを省略してかける
というもので、
仮に宣言がない場合はSystem.Console.WriteLine
という記載の仕方になる。

int age = 40;

if (age >= 30)
{
    Console.WriteLine("ベテラン社員");
}
else
{
    Console.WriteLine("若手");
}

if分に関しては基本的にその他言語と変わりがない

for (int i = 0; i < 10; i++)
{
    Console.WriteLine("Cnt: " + i);
}

for文による繰り返しも基本的には変わらない

現在私はC#で画面を作成し、
それらをJavaで動かしてPostgreSQLを更新したりしているが、
Unityなどとの相性もいいため
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?