阅读背景:

如何向线程函数传递多个参数?

来源:互联网 

     我们先来看一个简单的程序:

#include <stdio.h>
#include <windows.h>

DWORD WINAPI ThreadFun(LPVOID pM)
{
	printf("%s\n", pM);
	return 0;
}

int main()
{
	printf("main thread\n");
	HANDLE handle = CreateThread(NULL, 0, ThreadFun, "hello world", 0, NULL);
	CloseHandle(handle);

	Sleep(2000);

	return 0;
}#include <stdio.h>
#inc



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: