我正在使用 C/C++ 在 Windows 上开发一个应用程序。我想知道,我怎样才能得到 a file/directory
from的完整路径filename/directory
?
例如:我的文件名是test\test.txt
,实际上它位于C:\Sample\test\test.txt
,我的项目位于E:\MyProject
.
那么我怎样才能得到完整的路径,即C:\Sample\test\test.txt
从文件名test\test.txt
。任何目录也是如此。
我试过使用 GetFullPathName 但它只返回E:\MyProject\test\test.txt
不正确的。
提前致谢。