Sintaxe
type-return ([modifier] *[variable])([type , [type , [type , ...]]])
Veja
void (*variavel)(int, int, char); // declara a variavel variavel = (void(*)(int, int, char))0x00FF00FF; // atribui o valor do seu endereço a ser chamado variavel(10, 20, 6);
ou
( (void(*)(int, int, char)) 0x00FF00FF ) (10, 20, 6);
Código de exemplo
void function1(int x, int y, char z) { printf("Function1 - X: %d, Y: %d, Z: %d\n", x, y, z); } int function2(int x, int y, char z) { printf("Function2 - X: %d, Y: %d, Z: %d\n", x, y, z); return (x + y + z); } int main() { void(*f1)(int, int, char); int (*f2)(int, int, char); f1 = &function1; f2 = &function2; f1(1,2,3); int result = f2(4,5,6); printf("Result: %d", result); return 0; }
Att, Gilson Fabiano