I wanted to do something using multi-threading and all the stuff encapsulated in function foo .
filterThread = _beginthread (foo, 0,NULL) ;
and I wanted to let foo return value:
int foo()
{
return iRet;
}
but the prototype of _beginthread _CRTIMP uintptr_t __cdecl _beginthread (_In_ void (__cdecl * _StartAddress) (void *), shows that
_In_ unsigned _StackSize, _In_opt_ void * _ArgList)foo must be void which means cannot return value .
Is there any way else i can do to let foo return value?
To get the return value aka exit code of thread:
Call this function on thread’s handle after it has finished,
As an example, consider using _beginthreadex instead,