Hi.
I can't seem to figure out why my thread doesn't show the value 10. I get some 7 digit number instead.
Can anyone see the error?
Code:#include <stdio.h> #include <windows.h> void ThreadProc(void *param); int main() { int val = 10; HANDLE handle = (HANDLE) _beginthread( ThreadProc,0,&val); // create thread WaitForSingleObject(handle,INFINITE); return 0; } void ThreadProc(void *param) { int *h =¶m; printf("%d\n", h); _endthread(); }