C/C++の宿題片付けます 157代目
■ このスレッドは過去ログ倉庫に格納されています
もうひとつあった。
> printf("その数の二乗は%lfで\n三乗は%lfです。\n", sqr(d), cub(d));
%lf は褒められたものではない。%f にしておくのが無難。
ISO/IEC 9899:1999 6.5.2.2.6
If the expression that denotes the called function has a type that does not include a prototype, the integer promotions are performed on each argument,
and arguments that have type float are promoted to double.
These are called the default argument promotions.
■ このスレッドは過去ログ倉庫に格納されています