コメントと変数

コメント

コメントは2種類ある。

変数

変数の宣言と初期化の例

int $tmp = 2;
float $val = 3.5;
string $str = "test";
vector $vec = <<2, 3.2, 5.5>>;
print($vec.y); // 3.2 を表示 ( print $vec.y; ではエラーになる )
float $vec_x = $vec.x;
matrix $mat[2][3] = <<1.5, 2, 3.2; -1.5, 3, 4.3>>;
print($mat[0][1]); // 2 を表示
float $aval[2] = {3.5, 1.5};
string $strs[2] = {"test", "test2"};

参考


prev | next
Home | Contents
Mail