Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコード行でエラーが発生しないのはなぜですか?
double x = 4.2, y;
また、x は 4.2 に割り当てられているようで、y の値ではありません (1e-39、または 0 に非常に近いようです)。
double 型の変数を宣言xし、値 4.2 で初期化して、 という別の変数を宣言しますy。注: 現在値を保持していない理由。あなたの声明は次のように書くこともできます
x
y
double y, x = 4.2;