Check out "man 3 system" or "man 3 exec" for how to call a shell command from C/C++
However, you can do this directly from C/C++ using the "glob" library call, given "*" as an argument to return all files in a directory. From "man 3 glob":
One example of use is the following code, which simulates typing ls -l *.c ../*.c in the shell.
globbuf.gl_offs = 2;
glob("*.c", GLOB_DOOFFS, NULL, &globbuf);
glob("../*.c", GLOB_DOOFFS | GLOB_APPEND, NULL, &globbuf);
globbuf.gl_pathv = "ls";
globbuf.gl_pathv = "-l";
Does anyone think using a csh would help? If so, in what way? I was wondering if the name is "c" shell, it must have some benefits to C programmers, right?
csh has nothing to do with C, it is just named that because the syntax is similar to C...