DWORD WINAPI MyThread(LPVOID p)
{
char *szTopic = (char *)p;
printf("子线程,topic = %s\n", szTopic);
return 0;
}
void main(int argc,char *argv[])
{
char szTopic[100][100]={0};
for(int i=0; i<argc-1; i++)
{
sprintf(szTopic[i],"Tuiyan_%s",argv[i+1]);
HANDLE hThread;
hThread = CreateThread(NULL, 0, MyThread, LPVOID(szTopic[i]), 0, 0);
CloseHandle(hThread);
}
getchar();
}