Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:10:50+00:00 2026-06-09T18:10:50+00:00

I am writing a generic test function that will accept a function address (read

  • 0

I am writing a generic test function that will accept a function address (read from a map file) and arguments as comma separated data as arguments from a socket.

I am able to implement it for known function pointers.

like

void iif(int a, int b, float f);
typedef void (*fn_t)(int a, int b, float f);

With above approach I would write function pointers for all types of function implementation in the code base. Is there any generic way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:10:52+00:00Added an answer on June 9, 2026 at 6:10 pm

    No, since the compiler needs to know how to represent the arguments. It can’t know that for a function pointer type that excludes the information, and thus it can’t generate the call.

    Functions with a small number of parameters might pass them in CPU registers, “spilling over” to the stack when many parameters are called for, for instance.

    You can use varargs to come around this, doing so essentially “locks down” the way the arguments are passed. Of course, it forces the called functions to deal with varargs, which is not very convenient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before writing a function that takes a generic bidirectional iterator I wanted to test
I was writing a generic class to read RSS feed from various source and
I'm (re)writing a program that does generic unit test scheduling. The current program is
Say that I'm writing a test and my caret is here (indicated by |):
Im writing to a file using WriteFile . That works fine. Its just a
I am writing an activex control that will access the parallel port and write
I'm writing generic logger for SQLException and I'd like to get parameters that were
I'm writing some testing functions for a project. The test function takes a function
I'm writing a generic class where I need to use Interlocked. T test1, test2;
I am writing a generic Http resource hosting service and am storing larger objects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.