I am making a program where I want the user to enter the location and name of a file and then execute that file continuisly every 30 seconds...For example c:\timer.exe c:\windows\file.exe and I want file.exe to be fp. However the program crashes..any ideas?
Code:int main(int argc, char *argv[]) { FILE *fp; const int x = 10; fp = fopen(argv[0],NULL); while (x > 0) { system(fp); sleep (30000); } return 0; }