When trying to create a string literal
"C: \"the closing quote is escaped, which must be avoided.
you escape quotes, but you need to escape slash. Replace so
"C:\\"
or
"C:/"
There is also a variant of using raw string literals ( C++11
) to exclude escapes:
#include <iostream> int main() { const char* s = R"(C:\)"; std::cout << s << "\n"; }
C: \
Source: https://ru.stackoverflow.com/questions/545096/
All Articles
"C:\\"
- that's it.'\\'
is a backslash character. - andy.37