Definitely.
void f(void (*a)()) {
a();
}
void test() {
printf("hello world\n");
}
int main() {
f(&test);
return 0;
}
More Related Contents:
- How to Implement stack by function pointer and how to use it [closed]
- expected ‘void (**)(void *, const char *)’ but argument is of type ‘void (*)(void *, const char *)
- How do function pointers in C work?
- Casting a function pointer to another type
- Understanding typedefs for function pointers in C
- How can I use an array of function pointers?
- Function pointers and address of a function
- C function pointer casting to void pointer
- Why can’t I cast a function pointer to (void *)?
- How to format a function pointer?
- What is guaranteed about the size of a function pointer?
- How to get function’s name from function’s pointer in Linux kernel?
- How to print the address of a function?
- What are function pointers used for, and how would I use them?
- Does Function pointer make the program slow?
- Passing parameters dynamically to variadic functions
- When is an array name or a function name ‘converted’ into a pointer ? (in C)
- C late binding with unknown arguments
- C isn’t that hard: void ( *( *f[] ) () ) ()
- Dynamic method dispatching in C
- C syntax for functions returning function pointers
- How to create a typedef for function pointers
- Returning function pointer type
- & operator optional in function pointer assignment
- How can I call a function using a function pointer?
- MIPS program that implements the same algorithm in C
- Post-increment on a dereferenced pointer?
- How should I print types like off_t and size_t?
- Check to see if a pthread mutex is locked or unlocked (After a thread has locked itself)
- Pthreads vs. OpenMP