#define UNICODE
#define _UNICODE
#include <windows.h>
#include <stdio.h>
#include <process.h>
#include <tchar.h>
#include <conio.h>
typedef struct arg
{
int k;
}ARG;
unsigned __stdcall thread(void* arg)
{
int i;
ARG * pa=(ARG*)arg;
for(i=0;i <pa->k;i++)
_tprintf(TEXT( "%s "),TEXT( "_____come into thread___________\n "));
_getche();
_endthread();
return 0;
}
int _tmain()
{
unsigned threadid;
ARG s;
_tprintf(TEXT("%s"),TEXT("input K:\n"));
scanf_s("%d",&s.k);
_beginthreadex(NULL,0,thread,(LPVOID)&s,0,&threadid);
_getche();
return 0;
}
08-16
447

09-08
1574
