/*WAP Invoking a function using a pointer to a function */
#include<stdio.h> #include<conio.h> main( ) { int display( ) ; int ( *func_ptr )( ) ; func_ptr = display ; /* assign address of function */ printf ( "\nAddress of function display is %u", func_ptr ) ; ( *func_ptr )( ) ; /* invokes the function display( ) */ getch(); } int display( ) { puts ( "\nLong live viruses!!" ) ; }
No comments:
Post a Comment