|
|
|
|
|
|
Possible answers:
|
|
(This was what I learn back in 1980 or so....)
|
int main( int argc, char *argv[] ) { double a, b; a = 4.0; b = square( a ); // <---- First use // square() has not been defined yet !!! // The GNU C compiler will assume it is: int square(double) !!! } double square( double x ) // Now the C ompiler detects that the assumption was wrong { double r; // Define a local variable r = x * x; // Statement return ( r ); // Return statement } |
Observation:
|
Therefore, the C compiler does not know the data types of the parameters (and return value) and:
|
|
How to run the program:
|