16,551
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <Windows.h>
#include <process.h>
void __cdecl SlotSend(void* ch)
{
int count =0;
while(1)
{
count++;
if(count == 20)
{
printf("over");
break;
}
}
_endthread();
return ;
}
int main()
{
char ch='a';
int m_handle=_beginthread(SlotSend,0,NULL);
Sleep(2000); //加点延时,要不然主线程退出了printf会异常
return 0;
}