faqts : Computers : Programming : Languages : C

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 3 people (67%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

what is the syntax for caliing a function of variable no of arguments using funcyion pointer

Sep 22nd, 2005 13:33
Ankit Sharma, sudhir patnaik,


Suppose you have a function:
int var_func(int n, ...)
Function pointer for this can be declared as 
int (*var_arg_fn)(int, ... );
Now you can do the assignment as:
var_arg_fn = var_func;
use it as given below:
var_arg_fn(2,3,4,5,7);