home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
WINDOWS
/
PROGRAM
/
T_BCINFO.ZIP
/
TI639.ZIP
/
TI639.ASC
Wrap
Text File
|
1992-02-25
|
815b
|
67 lines
PRODUCT : C++ NUMBER : 639
VERSION : All
OS : PC DOS
DATE : February 25, 1992 PAGE : 1/1
TITLE : Creating a Pointer to Member Function
#include <stdio.h>
class testclass {
public:
void test(int x) { printf("-> %d <-", x); }
};
void main(void)
{
testclass xxx;
void (testclass::*p_func) (int); // p_func is type pointer to member
// function accepting an int and
// returning void
p_func = testclass::test; // assign p_func the address of test
(xxx.*p_func) (3); // call test
}