James wrote:

> oh, what's the ANSI-C way to do function prototypes? i did a C exam and
> did them like this:
> 
> int foo (char *bar, int baz);
> 
> but aparrently it should have just been:
> 
> int foo (char *, int);

Specifying the parameter names is optional. Whether or not to do so is
largely a matter of style. It can help to document the function's
parameters.

OTOH, in header files, it's generally best to avoid using any symbols
unnecessarily, in case the symbol has been #define'd to an expression
(which may result in compilation failing).

You can get the best of both worlds by enclosing the parameter name
within a comment, e.g.

        int foo (char * /* bar */, int /* baz */);

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to