Advertisement Jump to content


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


Universal Function Pointer

This topic is 5885 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
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!