Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

460
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!