Jump to content
  • Advertisement


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


Function Pointer

This topic is 5856 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

I don''t think you can, I think when you overload a function it''s really just several functions using the same name with different signatures, hence the same function can have several different addresses.

#include <cassert>

void Function(void) {}
void Function(int) {} // overloaded functions

int main(int argc, char *argv[])
void(*a)(void) = &Function;
void(*b)(int) = &Function; // got addresses from the same function

assert((void *)(a)!=(void *)(b)); // yet they are different

return 0;

Share this post

Link to post
Share on other sites
I think so, because the function pointer have parameters. So, if your function pointer keeps the same name but have different parameters, it should be overloaded...

/* Bullmax */
Reality has many forms : good and evil, black and white, ying and yang.

Share this post

Link to post
Share on other sites
Thanks... I just did a switch to have the user select the message type then assign the value of the member function of the class which returns the apporpriate message loop, i.e. PeekMessage or GetMessage...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!