![]() |
Get member function address
Is there an easy way to get the memory address to a member function? I don't really trust (understand) the output of this code...
:
#include <iostream>:
Output:Why does it writes "1" to the screen in both functions? How do I make it print the real memory address? Thanks for your help! /Klarre |
A member function doesn't have a unique address for each object, you need both a pointer to the member function an object to call it with. The the C++ FAQ.
|
Quote:
/Klarre |
I believe you need to fully qualify the function name, i.e. &Foo::member_func. Here is a note from Microsoft on it-
Quote:
|
| All times are GMT -5. The time now is 2:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC