スポンサード リンク
Microsoft Visual C++にて以下のソースでコンパイルエラーが発生します:
コンパイルエラーメッセージ:
warning C4305: '初期化中': 'int' から 'bool' へ切り詰めます。
ソース(バグ有り):
#include <stdio.h> #include <math.h> int main() { bool n = -5; printf("%dの絶対値は%d \n",n,abs(n)); } |
ソース(修正済み):
#include <stdio.h> #include <math.h> int main() { int n = -5; printf("%dの絶対値は%d \n",n,abs(n)); } |
スポンサード リンク