Array of pointers that point Functions

Asked

Viewed 36 times

1

Good afternoon.

I wonder if the code below is correct. I have a little bit of pointer difficulty and I entered this area of pointers to functions and I would like to understand more about this option.

//Declarando o ARRAY de ponteiros que apontam funções
void (*funcoes[2])(void) = {&funcao1, &funcao2};
funcaoQueEnviaOArray(funcoes);

//Declarando a função que recebe o array
void funcaoQueRecebeArray(void (*arrayFuncoes[])(void)){
    //Chamando a função dentro do array
    arrayFuncoes[0]();
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.