+ 1
What's wrong if I use string as "c::\\"
Hi Refer code below: It works fine. If I change the file name to c:\ (uncomment the commented line), it displays wiered results. What's wrong with this code ? https://sololearn.com/compiler-playground/ck4g81fjBLhc/?ref=app
3 ответов
+ 1
Sololearn compilers run on linux, so windows \\ would not be recognized.
https://stackoverflow.com/questions/122455/handling-file-paths-cross-platform
+ 1
Ketan Lalcheta
oh, I see what you mean. the second string seems to be parsed into ..\Playground\ when used in cout...
not sure if it's a Sololearn thing.
But here is my workaround if you just want the string to be displayed:
(you shouldn't actually use raw string as path, though)
https://sololearn.com/compiler-playground/c1JjZMZjutfW/?ref=app
0
I am just using it as a string and not used as actual path of file system.
It is a raw string for me named as file name. Is it something string has this restrictions imposed ?