home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / learn / funcptr1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  278 b   |  18 lines

  1. /* FUNCPTR1.C: Passing function pointers as arguments. 
  2. */
  3.  
  4. #include <stdio.h>
  5.  
  6. void gimme_func( void (*func_ptr) () );
  7.  
  8. main()
  9. {
  10.    gimme_func( puts );
  11.    gimme_func( printf );
  12. }
  13.  
  14. void gimme_func( void (*func_ptr) () )
  15. {
  16.    (*func_ptr) ( "Ausgezeichnet!" );
  17. }
  18.