is tther a sleep() like function that use standard libraries that requires no change when moving from UNIX to Win. C++
cross platfor sleep() ?
Collapse
X
-
Originally posted by jpenguinis tther a sleep() like function that use standard libraries that requires no change when moving from UNIX to Win. C++
Not done much cross-platform programming myself, but I beleive if you use the following tags your program should work;
Code:#ifdef DOSMODE #include <io.h> #endif #ifdef UNIXMODE #include <unistd.h> #endif
-
Originally posted by thenath24Hi,
Not done much cross-platform programming myself, but I beleive if you use the following tags your program should work;
Code:#ifdef DOSMODE #include <io.h> #endif #ifdef UNIXMODE #include <unistd.h> #endif
Code:#ifdef _WIN32 //includes dos.h only when #include <dos.h> //using the borland c++ #endif //compiler [used for sleep()] #ifdef __unix__ #include <time.h> //used for sleep() on *NIX-based systems #endif
Code:sleep(1);
Comment
-
Comment