Category : C Source Code
Archive   : C-ALL.ZIP
Filename : TI639.ASC

 
Output of file : TI639.ASC contained in archive : C-ALL.ZIP







PRODUCT : C++ NUMBER : 639
VERSION : All
OS : PC DOS
DATE : September 17, 1991 PAGE : 1/1

TITLE : Creating a Pointer to Member Function




#include

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
}


































  3 Responses to “Category : C Source Code
Archive   : C-ALL.ZIP
Filename : TI639.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/