I am trying to compile a simple program on 64 bit Windows 7 and I have a crash problem.
My app is crashing when ever I call a function, and according to QT Creators debug tool it is being caused by a segmentation fault.
I do not understand what is wrong though. Any ideas?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <windows.h>
int getHour(){
LPSYSTEMTIME systemTime = NULL;
GetSystemTime(systemTime);
return (int)systemTime->wHour;
}
//The crash occurs when the following is called:
int main(){
int n = getHour();
}