mercredi 3 septembre 2014

c programing command line arguments


Vote count:

0




I have written three programs,ls,ls-a,ls-l.and executing the programs by using command line arguments in ls program.instead of that i want to run three programs in one program instead of having three separate files. please help me in this. the code i have used is:



if (argv[1] != NULL) {
if (!strcmp(argv[1], "-a")) {
system("./lsa");
exit(0);}

if (!strcmp(argv[1], "-l")) {
system("./code");
exit(0);
}
}


./lsa and ./code are my .exe files.


thank you.



asked 1 min ago







c programing command line arguments

Aucun commentaire:

Enregistrer un commentaire