[英]How can I get current file path using boost?
如何使用 boost 獲取當前文件路徑? 就像在 a.cpp 中一樣,我可以得到
/home/src/a.cpp
我可以使用_FILE_
宏來獲得這個,但由於某種原因我不能使用_FILE_
。
有任何想法嗎?
我想你正在尋找
#include <boost/filesystem.hpp>
boost::filesystem::path full_path(boost::filesystem::current_path());
或者
auto p = boost::filesystem::current_path()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.