Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Zomart

Universal Function Pointer

This topic is 5650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey- I''m trying to create a plugin system that has no requirements on the return types or parameters. I was wondering if there was any way to have one definition of a function pointer that will be able to point to any function or if there is any other way to create the desired effect. I''ve tried using linked lists of void pointer data, but programming that becomes a mess, so if anybody knows a better way I''d love to hear it. Thanks..

Share this post


Link to post
Share on other sites
Advertisement
typedef int (*PointerToAnything)(...);

that will be ok with anything that returns a 32-bit value, including pointers, but if you want to return structs by value you're (i think) out of luck.

[edited by - niyaw on December 7, 2002 2:23:02 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!