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.

[備忘録]学習中言語の構文比較

Last updated at Posted at 2020-08-05

学習言語の構文を比較
理解の範囲での記載なので、理解が足りてない箇所がある可能性あり。
随時更新

内容 C/C++1 kotlin javascript
変数宣言 int a=0; var a:int = 0 let a = 0;
定数宣言 const int a=0; val a:int = 0 const a = 0
型付け 静的(型推論なし) 静的(型推論あり) 動的
行末セミコロン 必須 冗長 任意
if文 if(条件) if(条件) if(条件)
else if(条件) else if(条件) else if(条件)
else else else
for文 for(int i=0; i < 10; i++) for(i in 0..9) for(let i=0; i < 10; i++ )
配列 int a[2] ?? let a = []
要素追加 不可(vectorとか使う) ?? a[2] = "要素"
  1. たぶんC++98 or C++03基準。どっちなのかは不明

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?