Here is the code in question:
double cf_converter(double t){
//This function converts from celsius to farenheit
if (t <= 200 && t >= -200){
printf("0.00 C ==> 32.00 F");
return CFR*t+32.00;
}
else{
printf("Invalid Farenheit Temperature\n");
return pow(t,3);
}
}
The above function is where the compiler tells me the error is occurring. I have looked at other examples, but I can't determine why I'm getting the error. The error is apparently occurring, according to the compiler, in the first return statement, where it reads CFR*t+32.00.
void main(){
//Main Loop
char c;
double t, o, input;
printf("Please enter F or C: ");
scanf("%c", &c);
switch(c){
case 'c':
case 'C':
printf("\nPlease enter a celsius degree number: ");
scanf("%lf", t);
o = cf_converter(t);
break;
case 'f':
case 'F':
printf("\nPlease enter a farenheit degree number: ");
scanf("%lf", t);
o = fc_converter(t);
break;
default:
printf("\nThat input is unknown.");
break;
}
}
The above is my main function, as it's currently written. There is an fc_converter() function that is identical the cf_converter function, except the return statements are slightly different. I'm using stdio.h and math.h for some functions (like pow(t,3)).
And in response to questions, CFR looks like this:
#define CFR = 1.8