Long story sort, I'm making a thread in c++ that starts a timer.
When a user starts playing the game, it starts the thread, and when user logs out - thread stops. - thus giving me the total time played.
When using the code to start the thread -
hThreads = CreateThread(NULL,0,Timer,(LPVOID)0,NULL,&id);
it only works when I place this code into int main()
when I try and place the line where i need the thread to start - void start() - I get this error:
110 main.cpp [Warning] passing NULL used for non-pointer converting 5 of `void* CreateThread(_SECURITY_ATTRIBUTES*, DWORD, DWORD (*)(void*), void*, DWORD, DWORD*)'
Any ideas? Thanks alot