TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRISTOPHER BUTLER
from: JERRY COFFIN
date: 1997-11-08 12:13:00
subject: `Use :: to get the address of a member f12:13:1311/08/97

On (06 Nov 97) Christopher Butler wrote to All...
 CB> How do I get the address of a member function?
_Very_ carefully! 
 CB> For example:
 CB> class foo
 CB> {
 CB>  public:
 CB>     foo();
 CB>     void interrupt myInt(...)
To act as an interrupt handler, your member function must be static.
 CB> }
 CB> foo::foo()
 CB> {
 CB>     _dos_setvect(0x1C, &myInt); // Here is where I want to get the
Once you've made myInt static, this should work just fine.  In fact, you
don't even need the `&' if you don't want it.
I should add that this is entirely different from getting the address of
a normal member function.  However, since a normal member function won't
work as an interrupt handler (the CPU doesn't generally know enough to
pass us a `this' pointer) we won't worry about that for the moment.
    Later,
    Jerry.
--- PPoint 2.02
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.