Skip to main content
GameDev.net gamedev.net
🔒 Locked

pointer to a . function???????

Started by Farraj Jan 13, 2007 at 11:08 PM 8 replies 700+ views
Original Post
Farraj
Farraj
Is this even possible?? What’s this method called I want to Google it. Thanks.
erissian
erissian
Do be clear, you mean a member function pointer?
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
AdamGL
AdamGL
I am not sure that functions take up memory in the same way. What would you assign the value of the pointer to? What information does a function retain? I am pretty sure you can't, but I am still curious. Any experts on this?
bi-FreeSoftware
erissian
erissian
Quote:
Original post by AdamGL
I am not sure that functions take up memory in the same way. What would you assign the value of the pointer to? What information does a function retain? I am pretty sure you can't, but I am still curious. Any experts on this?


Sure you can, at least in C...

http://www.newty.de/fpt/index.html
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
RDragon1
RDragon1
In C++:

http://function-pointer.org/
Ra
Ra
Yes, you can create function pointers, but they're generally considered bad practice. As someone mentioned above, function-pointer.org is a good resource.

If you're using C++ you'll probably want to look into functors (function objects) as an alternative to function pointers, though it really depends what you're trying to do.
Ra
erissian
erissian
Quote:
Original post by RDragon1
In C++:

http://function-pointer.org/


Quote:
Original post by Anonymous Poster
If you are using C/C++, take a look here:

Function Pointer Tutorial


Sorry, I probably could have saved you both a little time by mentioning that the Function Pointer Tutorial, previously found at http://function-pointer.org/ has been moved to the address I mentioned above.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
_goat
_goat
Agreeing with Ra, boost::function and boost::bind are the best things to happen to function pointers since sliced bread. That's right - sliced bread happened to function pointers. Link to boost in my signature.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.