next up previous contents index
Next: Global variable definition Up: Smac definition Previous: Smac definition

Function definition

 

You must declare functions before use, but of course, when you define a function, you declare it at the same time. You can both use an old style to declare a function arguments list:


tabular1492

or the ANSI C syntax:


tabular1498

You cannot define a function with a variable number of arguments (ellipsis) , although some predefined functions use this facility (e.g. printf()). Classically, by default, the function return value type  and its parameters  type are int.

You cannot redefine  predefined functions, and when you redefine a user function or variable Xcoral displays a warning to avoid surprises. This default protection can be changed with the debug_mode() function (see §6.6.4 page gif).



Lionel Fournigault
Fri Nov 6 17:00:30 MET 1998