In C,why is definition of a global variable in a separate statement raising warning,but is OK for a local variable?
问题 In the following code, why does the definition of the global variable "x" show the warning "data definition has no type or storage class" but the same thing works fine for the local variable "y"?All I am doing for each variable is first declare them in one statement and then define them in another statement.What is the difference that it works fine for one but shows warning for the other? #include<stdio.h> int x; x=303; int main(void) { int y; y=776 ; printf("The value of x is %d,and of y is