This newsgroup is specifically for discussions about the C standard -
it's not about how to use C. Furthermore, the C standard doesn't have
anything to say about directories or pathnames. It's meant to be
implementable, and has been implemented, even on systems where
directories are a meaningless concept. The answer to your question
inherently depends upon the operating system you're using. Of course,
that's equally true of any use of the system() function.
On the systems I'm most familiar with, you could set cwd = open(".",
O_RDWR) to open the current directory. Then call chdir(otherpath) to
change the current directory. Finally, when you're done, call
fchdir(cwd) to return to the original directory. Then call close(cwd).
Remember to check each of these function calls for error indications.
Warning: I've never had reason to do this, and therefore can't be sure
that I've correctly interpreted the documentation which explains how
to do it. In any event, there's no guarantee that this will work on
your system - those functions are part of Unix, not the C standard