Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

How to use a pointer to a member function of a class

$
0
0


#include <stdio.h>
#include <IOSTREAM>

class TestA
{
public:
	int __stdcall SayHello(int person);
};

int TestA::SayHello(int person)
{
	printf("hello world!%d",person);
	return 0;
}

int (__stdcall TestA::*CallSayHello)(int person);
typedef int (__stdcall TestA::*XSayHello)(int operation);

XSayHello hello;

int main()
{
	//(*CallSayHello)(1);
	//hello(1);
	system("pause");
	return 0;
}

How to use "CallSayHello" and "hello" in function "main"?

Thanks.

Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>