gpt4 book ai didi

c - scanf 行出现错误消息?

转载 作者:行者123 更新时间:2023-11-30 20:06:41 25 4
gpt4 key购买 nike

//Get Celcius

double getCelsius()

{
double c;
printf("Please enter a temperature in degrees Celcius");
scanf("%f",double c);
return c;
}

double getFahrenheit()//FUNCTION DECLARATION
{
double f;//VARIABLE DECLARATION
printf("Please enter a temperature in degrees Fahrenheit");
scanf("%f", double f);
return f;
}

最佳答案

使用 scanf 扫描 double 值需要

%lf 。还有 scanf("%lf",&c);scanf("%lf",&f);

关于c - scanf 行出现错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22004689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com