G said:
going on
What do you mean? Of course int is a keyword.
No, the defintion you gave is not an old style(K&R style) definition.
It's a C89/C99 style definition.
This below definition fits the description of a C89 and K&R style
definition (not valid in C99).
foo(length, factor, multiple) {/* body */}
I was just wondering how the compiler treats this (new or old way).
G - Your first example in not a function definition at all. It doesn't
have a function name. Old-Style definitions look like ..
int foo(len, fac, mul) int len; float fac; float mul; { /* body */ }
... while C89 and onward looks like ..
int foo(int len, float fac, float mul) { /* body */ }
This latter allows the function to be declared before use or prototyped
so that the compiler knows exactly how to call it and with which
argument value conversions. Consider ..
int foo(int, float, float);
... is a prototype. The compiler, having read this prototype, when it
finds the statement ..
foo(1.0, 2, 3);
... will convert the arguments to int, float and float before calling foo().