i need to create a function that will accept a directory path. But in order for the compiler to read backslash in i need to create a function that will make a one backslash
But in order for the compiler to read backslash in i need to create a function that will make a one backslash into 2 backslash
The compiler only reads string when you compile, and in that case you will need two as the first back slash will be an escape character. So if you were to have a static path string in code you would have to do something like this:
std::string path = "C:\\SomeFolder\\SomeTextFile.txt";
The compiler will never actually call your function only compile it. So writing a function like this so the compiler can read a string is not going to solve your problem.