想尝试一下多线程,为什么运行后没反应?
#include <windows.h>
#include <process.h>
#include <stdio.h>
unsigned __stdcall myfunc1 (void * p);
void main()
{
unsigned long thd;
unsigned tid;
thd=_beginthreadex(NULL,0,myfunc1,0,0,&tid);
if (thd!=NULL)
{
CloseHandle(thd);
}
}
unsigned __stdcall myfunc1(void * p)
{
while (1)
{
printf ("1");
}
}