dimanche 14 octobre 2018

How do i replace '\' by '\\' in C++ to deal with escape sequences?

i want to deal with escape sequences, if i store a string in variable such as "a\b\ncd\ref" then i want output same as the string i given i.e, "a\b\ncd\ref" . Compiler should not interpret. I tried using regex_replace and many things else, but i couldnt acheive anything. It would be of great help if someone could suggest a solution.

Aucun commentaire:

Enregistrer un commentaire