I wrote a program that deletes the TDS EXE and OBJ of a file.
(I do this because I compile so many programs and I delete them
and keep only the .C or .CPP files)
so I wrote another program, called it DUMP. It takes command
line args. For example, if i want to delete all files (OBJ TDS EXE)
of DRAGONWAR.CPP, I will simply type DUMP DRAGONWAR
and it will delete OBJ TDS EXE of DRAGONWAR file.
Here's the code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main(int argc, char *argv[])
{
char one[20] = "DEL " ;
char two[20] = "DEL ";
char three[20] = "DEL ";
strcat(one, argv[1]);
strcat(one, ".tds");
strcat(two, argv[1]);
strcat(two, ".exe");
strcat(three, argv[1]);
strcat(three, ".obj");
printf("%s\n%s\n%s\n", one, two, three);
system(one);
system(two);
system(three);
}
My problem is that this code is not always working. What could
the reason be?