Reputation: 47
This is the code I'm compiling:
#include <stdio.h>
main(){
printf("Table of temperature conversions\n");
float fahr, celsius;
int lower, upper, step;
lower = 0;
upper = 300;
step = 10;
celsius = lower;
while(celsius <= upper){
fahr = (9.0/5.0)*(celsius + 32.0);
printf("%3.0f %6.1f\n", celsius, fahr);
celsius = celsius + step;
}
}
And I get the following warning:
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
I was just curious, what variable is it complaining about not having a typing?
Upvotes: 0
Views: 416
Reputation: 137398
The prototype for main
should be:
int main(void) {
// ...
return 0;
}
If it is to take the command-line arguments:
int main(int argc, char** argv) {
// ...
return 0;
}
The return type (int
) is required.
Upvotes: 3
Reputation: 412
It is not complaining about a variable, but about the main function.
You should type int main()
to suppress that warning.
Upvotes: 0