I have coded a little app that does something like the following:
sprintf(command, "......sending this string to system......{} \;"
printf("%s\n",command);
system(command);
break;
The problem is that not the whole string is sent to system, everything appears in my shell apart from the ‘\’ which doesn’t for some reason? I am sure its a silly mistake really, I am a novice.
Thank you
The
\is an escape character (you just used it to print a newline using\n), so if you want to print a literal backslash, you need to use\\: