I am trying to run very simple program with sleep() function under Turbo
c++ 3.1 (Visual Edition). But it does not compile, it showing "Function
sleep should have a prototype". Could anyone help me to find out what I
am doing wrong. It might be some configuration problem, but I don't know
what's wrong. My program is given below. My email address is
"amo...@idirect.com".
#include <stdio.h>
#include <dos.h>
void main (void)
{
printf ("About to sleep for 5 seconds \n");
sleep (5);
printf ("Awake \n");
}
Thank you very much.
-- Mohsin Ali.
<Jack>
If by "Visual Edition" you mean Windows version, note that the sleep()
function is only usable in MS-DOS, and not Windows, programs. Here is
a paste from the dos.h header file from Borland 3.1:
#if !defined( _Windows )
void _Cdecl sleep( unsigned __seconds );
void _Cdecl sound( unsigned __frequency );
#endif
</Jack>