•  Back 
  •  C Language 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : C-Language Documentation
Author      : John Kormylo
Version     : C.HYP 1.0
Subject     : Documentation/C-Language
Nodes       : 233
Index Size  : 6362
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : en
@default    : 
@help       : Help
@options    : +g -i -s +x +z -t4
@width      : 75
View Ref-File[ ANSI Function Definition ]

Syntax:
  [static] [<type>] [<parm>] <name> (
    <type> <arg name>,
    <type> <arg name>,
    ... )
   {
    <local block>
   }

where <type> is a data type,
<parm> is either 'cdecl' or 'pascal',
<name> is the function name,
<arg name> is a parameter name, and
<local block> consists of local variable definitions and executable
code.

If there are no parameters, the syntax is

  [static] [<type>] [<parm>] <name> (void)
   {
    <local block>
   }

Example:

  float trace(      /* returns trace of matrix a */
    int n,          /* dimension of matrix a     */
    float a[N][N] ) /* array a    (N is a macro) */
   {
    float sum;
    int i;

    sum = 0.0;
    for(i=0; i<n; i++) sum = sum + a[i][i];
    return(sum);
   }

See also Names.