Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

465
Visualizações
What does int (*func)() do in C?

What does this line do in C?

 int (*func)();

I extracted it from the following program that is supposed to execute byte code (assembly instructions converted to its corresponding bytes)

char code[] = "bytecode will go here!";
int main(int argc, char **argv)
{
  int (*func)();
  func = (int (*)()) code;
  (int)(*func)();
}
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

The line in question declares a function pointer for a function with unspecified arguments (an "obsolescent" feature since C99) and with return type int.

The first line of your main declares that pointer, the second line initializes the pointer so it points to the function code. The third line executes it.

You can get a description of pointers to functions in general here.

over 4 years ago · Santiago Trujillo Relatório

0

int (*func)(); declares func as a pointer to a function that returns an int type and expects any number of arguments.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda