This question talks about using the system command and passing variables. Here is an example it gives:
string cmd(\"curl -b cookie.txt -d test=\
See the man page listing all syscalls (system calls are not the system(3) function which forks a shell).
Read more about system calls and linux kernel, and the overall organization of operating systems
Back to your question, you could quote for the shell (just follow the shell escape rules to transform your strings; for example prefix any non-letter character with a backslash).
See also the man pages of fork, execve, etc.
Read a good book on advanced linux programming and the famous Advanced Unix Programming
Use the freedom of most of the software on a Linux distribution. For example, you could study the source code of a simple shell like sash.
And perhaps you just want to use curl. Then the best way is to code for the libcurl library (without any call to system(3))
Have fun learning all this!