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.
Problem:
When using the code to start the thread -
hThreads[0] = CreateThread(NULL,0,Timer,(LPVOID)0,NULL,&id[0]);
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