Jun 13, 2012 at 4:41am UTC
I want it to wait 15 seconds im on windows.
sleep(15)
Sleep(15)
nether work?
Jun 13, 2012 at 4:48am UTC
The parameter is milliseconds:
Sleep(15000);
Jun 13, 2012 at 4:50am UTC
Just says sleep is undeclared.
Jun 13, 2012 at 5:00am UTC
Did you add #include <windows.h>
?
Jun 13, 2012 at 5:07am UTC
Ok works. This is my full code
while (pause == 1)
{
Sleep(1000);
date += 1;
cout << date + "\n";
}
but it has weird output it is pauseauseusesee
and i want it to say the date?
Jun 13, 2012 at 3:21pm UTC
iF I REMOVE THE \N IT WORKs but it need a line break.
Last edited on Jun 13, 2012 at 3:25pm UTC
Jun 13, 2012 at 3:24pm UTC
What type is date? I can't think of a type that would responed sensibly to having the number 1 added to it, AND having "\n" added to it.
Jun 13, 2012 at 3:31pm UTC
Hi there,
What you mean to use is this:
cout << date << "\n" ;
All the best,
NwN