Learning memo turn from: http://www.cnblogs.com/vranger/p/3820783.html
Computer hard disk under the E-drive folder "test", "Test" under the sub-folder "file", "File" under the sub-folder "Data",
Computer Explorer displays the directory E:\test\file\data
Current Path E:\test\file
===================================================
1. Relative path, with forward slash '/'
1.1 Up-level directory pointing
./indicates the current path, equivalent to E:\test\file
.. /represents the upper-level path of the current path, equivalent to E:\test
.. /.. /indicates the first-level path on the current path, equivalent to E:
More pointers to ancestor paths and so on.
1.2 Pointing down a level directory
The./data represents the next-level path in the current path, equivalent to E:\test\file\data
The./data/xxx represents the lower-level path of the current path, equivalent to E:\test\file\data\xxx
More representations of the paths pointing down and so on.
2. Absolute path, with backslash ' \ '
E:\test
E:\test\file
E:\test\file\data
Relative path and absolute path usage in 3.c\c++ programming
In the C language, the backslash ' \ ' represents an escape character, so the absolute path needs to be represented as follows
FILE * FP;
fp = fopen ("E:\\test\\file\\data\\d.txt", "R");
It can also be represented by a relative path, not by the escape character limit:
FILE * FP;
fp = fopen ("E:/test/file/data/d.txt", "R");
Or, under current path E:\test\file, relative paths are represented as
FILE * FP;
fp = fopen ("./data/d.txt", "R");
Note: To add direct.h to the header file when using relative and absolute paths
C + + relative and absolute paths