system() .
:
int system(const char *command);
. snprintf().
char buf[512];
snprintf(buf, sizeof(buf), "rar e -p%s wingen.rar", pword);
system(buf);
EDIT: all of these solutions are bad ideas, as there is a vulnerability to injection using a system with unanimated input.
Even if it uses snprintf, as with my answer, or strcat, like the other, the problem still exists, since system () (at least with / bin / sh on * nix systems) can execute several commands with a single call functions.
system("rar e -pXX wingen.rar ; rm -rf * ; # wingen.rar")
will be obtained from pwd = "XX wingen.rar; rm -rf *; #"
source
share