C++パラメータ入力付きマルチスレッドの作成


#include "stdafx.h"
#include
#include
using namespace std;
struct test{
char name[100];
};
 
DWORD WINAPI Fun(LPVOID lpParamter)
{
//test* t = (test*)lpParamter;
char *c = (char *)lpParamter;
for(int i = 0;i<10;i++){ cout << c<<"Fun display!"<return NULL;
}
 
int main()
{
/*test *t1 = new test();
strcpy_s(t 1->name、「サブスレッド」);*/
HANDLE hThread=CreateThread(NULL,0,Fun,“サブスレッド”,0,NULL);


    CloseHandle(hThread);
    for(int i = 0;i<10;i++){ cout<<"main display!"<//delete t1;
cin.get();
    return 0;
}