C++ Relative Paths
@Servant of the lord: the space was because if i don't use that space my letter "t" was erased.
' ' is an escape code for tab, in the same way '\n' is an escape code for a new line.
If you are using '\\' that shouldn't happen, and if you are using '/' it definitely won't happen.
You hit on something very important here, and this is ultimately the source of your problems.
In C++, literal string values use escape codes to present special characters.
For example \n is used in place of a newline, so:
"Hello\nWorld"
When evaluated becomes:
Hello
World
While you escape the escape character ( \ ) using predictably enough, the escape character, so if you wanted to say:
Hello\World
You would go:
"Hello\\World"
'\ ' is such an escape code ( it is how you encode a TAB ).
This is why you should use "/" for your path values, such as:
c:/my/path/somewhere
This has the advantage of being portable to every other non-DOS based OS under the sun as well.
Edit: Ironically \ + t is how you encode a tab on this site aswell apparently.
In C++, literal string values use escape codes to present special characters.
For example \n is used in place of a newline, so:
"Hello\nWorld"
When evaluated becomes:
Hello
World
While you escape the escape character ( \ ) using predictably enough, the escape character, so if you wanted to say:
Hello\World
You would go:
"Hello\\World"
'\ ' is such an escape code ( it is how you encode a TAB ).
This is why you should use "/" for your path values, such as:
c:/my/path/somewhere
This has the advantage of being portable to every other non-DOS based OS under the sun as well.
Edit: Ironically \ + t is how you encode a tab on this site aswell apparently.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement