I want to get user's command and execute it at some point.
Is it supposed to be a shell command (a single string which may contain shell-special character combinations like &&), or an executable followed by an argument list, to be executed by system PROGRAM LIST with no processing by the shell?
In the former case, any shell-special characters will be interpreted by the shell. In a way, you'd be introducing a shell injection vulnerability into your program. If the user passes types "echo hello world \`rm -rf whatever\`" as the command line argument, the string reaching the shell would be echo hello world `rm -rf whatever`, making the shell dutifully run rm -rf whatever before running echo hello world. Maybe that's what you want: after all, no security boundaries are crossed here, and the user is always able to rm -rf anything they want by typing the command instead of making your program do it.
The downside is having to quote anything that might contain spaces, dollar signs, single and double quotes and everything else. If you want to supply a file name I'm eating in bed.ogg to mpv, you have to first quote it "I'm eating in bed.ogg", then quote the quotes: "mpv \"I'm eating in bed.ogg\"". There, now it's safe to pass to your program -- if it's intended to use the shell to run the command lines. Note that you can't use single quotes here because of escaping rules, but you could if the file name didn't contain an apostrophe. Add a few layers of that ("I need to pass this file name to a program that runs a command line that runs another command line..."), and therein lies madness.
In the latter case, the arguments end up more or less directly passed to the execve system call, but they have to survive being an array of the arguments and not a single string. This way you can pass arbitrary NUL-terminated strings to the child process, no matter their contents, because a shell doesn't even come near them, so there's no danger in it interpreting `rm -rf whatever` and running it as a program, if you had a file named like that.