Why are there two slashes - forward and backward? [closed]
I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for /
and one for \
.Help me to get the logic behind slashes.
From the wikipedia article about the backslash:
Bob Bemer introduced the \ character into ASCII, on September 18, 1961, as the result of character frequency studies. In particular the \ was introduced so that the ALGOL boolean operators "∧" (AND) and "∨" (OR) could be composed in ASCII as "/\" and "/" respectively.[4] Both these operators were included in early versions of the C programming language supplied with Unix V6 , Unix V7 and more currently BSD 2.11.
/
is generally used to denote division as in 10/2
meaning 10 divided by 2. \
is generally used as an escape character as in \t
or \n
representing a tab and a newline character respectively.
There's nothing like a "forward slash". There's a "slash" /
and a "backslash" \
.
There's a long and IMHO ilarious discussion about that on the xkcd forum
One More Thing....
The Forward Slash /
is Used in *nix To Navigate to the Filesystem...
Like .... /root/home/vs4vijay
and The BackSlash \
is Used In Windows ...
Like ..... F:\Games\CounterStrike
精彩评论