Hello,
i am a beginner and need your help. The little programm should run and close another aplication(this works without the loop) every x seconds but it doesnt work :( .
Thank you for your help.
#include <stdlib.h>
#include <time.h>
#include<iostream>
void start (int);
using namespace std;
int main ()
{
int arrayLength= 0 ; //array length
int Time;
int time[arrayLength]; //array with all times
time[0]=20;
int j;
clock();
for (;;)
{
for(j=0;j<=arrayLength;j++)
{
Time=time[j];
int w = Time;// time modifier
//cout<< clock()/CLOCKS_PER_SEC<<"\n";
if((clock()/CLOCKS_PER_SEC)==Time)
{
time[j]+=w;
start (j);
}
}
}
return 0;
}
void start (int x)
{
if(x=0)
{
system("C:\\Control\\c++\\Test.exe");
system("C:\\Control\\c++\\do1.exe");
system("C:\\Control\\c++\\do2.exe");
system("C:\\Control\\c++\\Testend.exe");
}
}