2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 /* Author: E.G. Keizer */
9 char rcs_id[] = "$Id$" ;
11 /* Test a few declaration features */
13 forward function declarations,
15 pointer to function declarations.
18 static int sqr() ; /* forward declarations */
30 printf("sqr(4) %d\n",sqr(4)) ;
32 a[0]=sqr ; a[1]=sqrt ;
33 printf("(*a[0])(16) %d\n",(*a[0])(16) ) ;
34 printf("(*a[1])( (*a[0])(3) ) %d\n", (*a[1])( (*a[0])(3) ) ) ;
37 static int sqr(par) int par ; {
41 int sqrt(par) int par ; {
45 if ( par<0 ) return -1 ;
50 x1 = ( x2*x2 + par ) / (2*x2) ;
51 if ( i++>=100 ) return -2 ;
52 } while ( ( x2<x1 ? x1-x2 : x2-x1 ) > 0 ) ;
60 printf("a outside hide %d\n",a) ;
67 printf("a in hide %d\n",a) ;
72 printf("a in in hide %d\n",a) ;
75 printf("a in hide %d\n",a) ;