Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

function pointer in c

// Basic syntax
ret_type (*fun_ptr)(arg_type1, arg_type2,..., arg_typen);

// Example
void fun(int a)
{
    printf("Value of a is %d
", a);
}

// fun_ptr is a pointer to function fun() 
void (*fun_ptr)(int) = &fun;
 
PREVIOUS NEXT
Tagged: #function #pointer
ADD COMMENT
Topic
Name
5+4 =