Or the last one, because the old-style C function declaration can not specify the number and type of arguments, so the compiler does not check the function call.
Take a look at the following example:
#include <stdio.h>
int main (void)
{
void foo ();
void foo (double);
char C =;
Foo (c);
return 0;
}
void Foo (double D)
{
printf ("%f\n", d);
}
You'll notice that the program runs 0.000000.
The debug run will find that:
1. Because the Foo function is declared void foo (void), the argument C is not passed in at all;
2. Local variable D is a random value, my machine is 2.5463949521227207e-313, this number has exceeded the range represented by double so print out 0.000000
If you replace the declaration statement with a comment, you will find that the program runs 60.000000
Declaration and implementation are consistent, parameters can be passed, although calling Shishun is a char value, but the runtime enforces the type conversion to double.