This is an example of an error that I get on most code that I just don't understand.
Here's the code:
Code:
#include <stdio.h>
#include <stdlib.h>
float convert (float f);
int main()
{
float temp_f;
float temp_c;
printf("What is the temperature in fahrenheit: ");
scanf("%.2f", &float temp_f);
printf("The temperature in fahrenheit is %.2f", temp_f);
return 0;
}
The error is: error: expected expression before 'float'.
As mentioned above I get this alot and originally I didn't have the & in the scanf function, which I thought was the problem, but it gave me the same error even after adding it. Any ideas? (I am using Code::Blocks ver. 20.03)