正斜杠和反斜杠的区别 [英] Difference between forward and backslash

查看:57
本文介绍了正斜杠和反斜杠的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览文件系统时使用正斜杠和反斜杠有什么区别.还有 ./../ 有什么区别?

What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between ./ and ../?

推荐答案

嗯,在大多数语言中,反斜杠需要在字符串文字中转义,斜杠不需要.进一步的反斜杠仅适用于 Windows,而斜杠几乎适用于所有地方.

Well, in most languages backslashes need to be escaped in string literals, slashes do not. Further backslashes only work on Windows, while slashes work pretty much everywhere.

另一方面,当将路径名作为参数传递给 Windows 程序时,使用斜杠可能不起作用,因为许多 Windows 程序使用斜杠来表示命令行标志,因此您需要使用反斜杠.

On the other hand, when passing path names as arguments to Windows programs, using slashes might not work because many Windows programs use slashes to signify command line flags, so you need to use backslashes.

On . vs. ..:.是当前目录,..是父目录.

On . vs. ..: . is the current directory, .. is the parent directory.

这篇关于正斜杠和反斜杠的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆