Printing "\" to system with C not work? -
i have coded little app following:
sprintf(command, "......sending string system......{} \;" printf("%s\n",command); system(command); break;
the problem not whole string sent system, appears in shell apart '\' doesn't reason? sure silly mistake really, novice. thank you
the \
escape character (you used print newline using \n
), if want print literal backslash, need use \\
:
sprintf(command, "......sending string system......{} \\;" // ^^ // take note here
Comments
Post a Comment