Sign in to follow this  

what is the different between the \ and /

This topic is 4581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There no real difference, "/" just doesn't need an escape character.
I think "\\" doesn't work for Unix type file systems, but I'm not sure.

Share this post


Link to post
Share on other sites
The backslash ('\') is used as an escape character in C and C++ , so to represent the backslash itself you'll need to write '\\'. MS decided do use the backslash as primary path seperator, while all other (modern) OS' use the forward slash ('/').
So when programming for Windows only, the difference between both separators mainly is safety, since typos are less common while using forward slashes (remember the escape-character thing).
If your code is intended to compile on more than just the windows-platform, it is essential to use the forward slash as path separator, since most other OS' use it exclusively.

HTH,
Pat

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In the Olde Days?! Damn you young whipper snappers! :)


I believe that the forward slash is also a standard in web urls (e.g. when referring to directory paths in .html files)


Share this post


Link to post
Share on other sites

This topic is 4581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this