<分区>
我已经研究了这个错误的解决方案,但我还是不明白。
#include <stdio.h>
float calcF(float a, float b, float c);
int main(void)
{
float mag_flux_den, cur, len;
float result;
printf("What is the magnetic flux density in tesla? : ");
scanf("%f", &mag_flux_den);
printf("What is the current in the conductor in Amperes? : ");
scanf("%f", &cur);
printf("What is the length of the conductor in the magnetic field in metres? : ");
scanf("%f", &len);
result = calcF(mag_flux_den, cur, len);
printf("Force on the current carrying conductor: %f", result);
return 0;
}
float calcf(float a, float b, float c) //calculates force on the current carrying conductor{
float F;
F = a * b * c;
return F;
}
我正在使用 ideone.com,但仍然收到相同的错误消息(undefined reference to 'calcF'
)。任何帮助将不胜感激。