I don't use system(), but you can fork a process, with fork(), then in the child branch you execlp, execve, ..., a command. To build your command, you initialise a buffer and fill it with the parameters supplied by the user using strcpy.
Some examples are here...