簡體   English   中英

如何使用 boost 獲取當前文件路徑?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM