Programming Works

Set Path in programming

Christian Engineer 2011. 6. 4. 09:50
*'\' ( backslash )
- escape sequence (ex. \n : Line Feed(change the line), \r : carriage return)
- the character to express special character (ex. \\ : express the special character '\'(backslash))
- separate directory in 'Windows API' (c:\work\test.dat)
(In Windows programming, you have to write down like this c:\\work\\test.dat. Because \(backslash) is a special character)
(In Windows programming, you can also use /(slash) "c:/work/test.dat")

*'/' : slash
- separate directory in 'Linux' or 'Windows Programming'
- comment in Windows Programming (ex. // : Don't extract this line)


< Ubuntu(Linux) >
*Relative path
- Reference point : working directory
- . : current folder
- .. : upper folder

ex) Eigen/math (Eigen is the name of the folder which located in working directory. 'math' is also the name of the folder.)

*Absolute path
- Write down the path from the first prat of the file system
- The first part of the Ubuntu's file system is '/'

ex) /home/Eigen



<Visual Studio(Windows)>
- In 'Visual Studio', you can use both '/' and '\\'.