Programming Tips - C/C++: cast a void * into an enum. Such as at the start of a thread.

Date: 2015jun18 Language: C/C++ Q. C/C++: cast a void * into an enum. Such as at the start of a thread. A. Cast to intptr_t first, like this:
void threadMain(void *in) { MyEnum myenum = (MyEnum) (intptr_t) in; ... }