wad*_*far 1 c types function-calls
这个程序的第7行不是"pay = prt(pay);" 应该抛出编译或运行时错误,因为它将int传递给需要double的param?我用dev-c ++编译好了,用两行输出运行程序.请解释一下,谢谢.
#include <stdio.h>
int prt(double b);
main ()
{
int pay = 3;
double tax = 2.2;
pay = prt(pay);
prt(tax);
}
int prt(double b)
{
b *= 2;
printf("%.2lf\n", b);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
160 次 |
| 最近记录: |