home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / THIN C 2.0 / Projects / funcPtr / funcPtr.c next >
Encoding:
C/C++ Source or Header  |  1991-04-25  |  306 b   |  21 lines  |  [TEXT/THIN]

  1. #include <stdio.h>
  2.  
  3.  
  4. /********************************  SquareIt  ***/
  5.  
  6. int    SquareIt( int num )
  7. {
  8.     return( num * num );
  9. }
  10.  
  11.  
  12. /********************************  main  ***/
  13.  
  14. main()
  15. {
  16.     int        (*myFuncPtr)( int );
  17.     int        num = 5;
  18.     
  19.     myFuncPtr = SquareIt;
  20.     printf( "%d squared is %d.", num, (*myFuncPtr)( num ) );
  21. }