The command system() creates a new process to handle the specified command.
In most cases, this is neither performant nor useful. But of course you can start a process with C this way. You could also redirect the output to a file and then read this file again. More performant and without needing a file you can realize this by using system calls. The effort is not insignificant, since you have to redirect inputs and outputs to a pipe before starting the process instead of simply system(). While on Unix you would use a combination on fork(), pipe() and exec() this could be solved as follows on Windows:
Creating a Child Process with Redirected Input and Output
If you only want to get the contents of a directory, you can use the combination of FindFirstFile() and FindNextFile().
Listing the Files in a Directory