If my string contains:
a="abd\\aa\[1\]\\"
and if I try to write it to a file using fputs and fprintf, it writes the following to the file:
"abd\aa[1]\"
I want "abd\\aa\[1\]\\" to be written to the file. How can I accomplish this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
\character is a special character. Try it like this:EDIT
If you want
"abd\\\\aa\\[1\\]\\\\"to be written to the file, you have to double each backslash: