-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (26 loc) · 710 Bytes
/
main.cpp
File metadata and controls
35 lines (26 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h>
#include <Windows.h>
#include "ReloadableFunction.h"
int main()
{
// Keep an external counter for the number of times that the function has been called
static int externalCallCount = 0;
while (true)
{
// Clear the console window
system("cls");
// Call the function
int internalCallCount = DrawAscii(50, 20);
printf("Function internal call count: %d\n", internalCallCount);
externalCallCount++;
printf("Function external call count: %d\n", externalCallCount);
// Quit if 'Q' is pressed
printf("\nPress 'Q' to exit\n");
if (GetAsyncKeyState('Q') & 0x8000)
break;
// Update window at every 500 milliseconds
Sleep(500);
}
system("pause");
return 0;
}