A function like a variable, has an address location in the memory. It is therefore, possible to declare a pointer to a function, which can then be used as an argument in another function. A pointer to a function is declared as follows:
type ( * fp) ( ) ;
This tells the compiler that fp is a pointer to a function which returns type value.
We can make a function pointer to point to a specific function by simply assigning the name of the function to the pointer.
For example,
double (*P1)( ), mul ( ) ;
P1 = mul ;
declare P1 as a pointer to a function and mul as a function and then make P1 to point to the
function mul. To call the function mul, we may now use the pointer P1 with the list of param- eters. That is,
(*P1) (x,y)
is equivalent to mul ( x,y )
TABLE OF CONTENTS
...... ATM NETWORK ......... | ... COMPUTER NETWORK.. |
DATA COMMUNICATION | ..... NETWORK MANAGEMENT |
..NETWORK SECURITY | |
.. ISDN |
SQL/DBMS |
MORE TO COME... |
POINTERS TO FUNCTIONS
·
Labels: C
disable right
Labels
- ATM NETWORK (13)
- C (44)
- COMPUTER NETWORK (38)
- DATA COMMUNICATION (24)
- DBMS/SQL (30)
- DOWNLOAD E BOOKS (1)
- HTML (1)
- ISDN (4)
- NETWORK MANAGEMENT (27)
- NETWORK SECURITY (11)
- UML (6)
- WEB ENGG. (17)
About Me
- prince kumar
- bhopal, M.P., India