开发者

Why are there two slashes - forward and backward? [closed]

开发者 https://www.devze.com 2023-01-04 06:00 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_开发技巧 Closed 12 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消