Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <conio.h>
- long signed a = 0;
- long signed b = 0;
- DWORD WINAPI watek1(void *v)
- {
- while (1)
- {
- a+=2;
- b+=2;
- }
- }
- int main(int argc, char *argv[])
- {
- HANDLE watek_a = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)watek1, 0, 0, 0);
- for (int i = 1; i<1000; i++)
- {
- Sleep(200);
- printf("a = %d \t b=%d \t r=%d \n", a,b, a-b);
- if (_kbhit())
- {
- char w = _getch();
- if (w == 32)
- //
- }
- }
- CloseHandle(watek_a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment