Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

463
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda