arg. I hope the error message is enough. But probably not.
In the book, section 11.3, the example code fails to compile.
Basically, I don’t understand why the given definition for CUT_THREADROUTINE didn’t work.
#include <windows.h>
typedef HANDLE CUTThread;
//typedef unsigned (WINAPI *CUT_THREADROUTINE)(void *); // causes quoted error
//typedef void *(WINAPI *CUT_THREADROUTINE)(void *); // causes quoted error
typedef void *(*CUT_THREADROUTINE)(void *); // compiles
#define CUT_THREADPROC unsigned WINAPI
#define CUT_THREADEND return 0
//Create thread
CUTThread start_thread( CUT_THREADROUTINE func, void *data ) {
return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, data, 0, NULL);
}