I get an illegal operation error whenever I try to run this program:
I think line 18 causes the error, becuase wenever I remove it and I ask it to cout the lp_time variable I don't get an error. Any ideas?Code:#include <iostream.h> #include <windows.h> int main() { LPSYSTEMTIME lp_time; float sec; sec=NULL;lp_time=NULL; while (1==1) { GetSystemTime(lp_time); sec=lp_time->wSecond; //This line probably causes the error cout<<sec; } return 0; }





Reply With Quote