Link to home
Start Free TrialLog in
Avatar of lapijn
lapijn

asked on

Sleep-program

I'm trying to make a program whitch sleeps n seconds, with n the commandline-input:
//////////////////
#include <windows.h>
#include <iostream>

using std::cout;
using std::endl;

int main(int argc,int *argv)
{
  if (argc != 2)
  {
    cout << "Usage : Sleep n\nwith n: number of seconds\n" << endl ;
    exit(-1);
  }
 
  cout << argv[1]*1000 <<endl ;

Sleep(argv[1]*1000);

  return 0;
}

////////////////////
Why doesn't this works ???
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapijn
lapijn

ASKER

Thanks, works indeed.