path under linux and window

/  forward slash

\\ double slashes

\  back slash

\ menas an escape character in some programming languages like C++, C#

1. In Windows OS, the file path uses a  \  , we need two \\ because the first \ is considered as an escape character.

    strPath = "D:\\Program Files\\Microsoft Office\\Office15"

2. In Linux, the file path is 

    strPath = "//home //Michael//workspace//hello.cpp"

    strPath_2 = "/home /Michael/workspace/hello.cpp" 

    Both path are correct.     

    The root directory starts with a  /

posted @ 2020-01-01 10:20  心怀阳光  阅读(127)  评论(0编辑  收藏  举报