I'm new to this forum so please correct me if this is not the right place to post this...
I have created two threads in the following code, and was expecting the threads to behave quite differently than they actually did...
can someone please explain why this happens? I'd be more than grateful.
Why does the program output look like this?
DWORD ThreadFunc(LPVOID p)
n = *(int *)p;
for (int i=0; i<5; i++)
int _tmain(int argc, _TCHAR* argv)
HANDLE hThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)ThreadFunc, (LPVOID)&n, NULL, NULL);
for (int i = 0; i<5; i++)
char ch = getchar();
Thanks in advance.