Вы находитесь на странице: 1из 1

#include "stdio.

h"
#include "conio.h"
#include "stdio.h"
#include <windows.h>
DWORD WINAPI PrintfThreads(LPVOID);
int i=0;
int main()
{
HANDLE hThread;
DWORD dwThreadID;
hThread=CreateThread(NULL,0,PrintfThreads,(LPVOID)i,0,&dwThreadID);
Sleep(1000);
getch();
return 0;
}
DWORD WINAPI PrintfThreads(LPVOID num)
{
while(1)
{
if(num==(LPVOID)0)
while(i<=100)
{
printf("%d\n",i);
i++;break;
}
Sleep(1000);
}
return 0;
}

Вам также может понравиться