Next: Returning values via Up: Procedures Previous: Function names returning

A brief digression to non-ANSI C

There are two points arising when using earlier, non-ANSI compilers.

1. In ANSI C functions should be defined as above, but an alternative form is also available though discouraged:

   int smaller(var1, var2)
   int var1, var2;

This version is the only allowed form in earlier compilers but should be avoided in all new programs because it may be dropped in the future.

2. In ANSI C (and some but not all earlier compilers), functions which do not return a value through the name use type void to show this:

   void print_smaller(...)

Both C and ANSI C assume that no type declaration means int:

   smaller(...) is the same as int smaller(...)



Next: Returning values via Up: Procedures Previous: Function names returning


maspjw@
Tue Sep 27 15:29:34 BST 1994