C++ find path

hogeol·2022년 11월 29일
0

C/C++

목록 보기
5/9

Find path using 'filesystem' library

.sln dir
 ㄴ test_image
 ㄴ project_dir
#include <iostream>
#include <string>
#include <filesystem>

int main(int argc, char **argv)
{
  std::filesystem::path path{"../test_image"};
  std::string img_path{std::filesystem::absolute(path).string()}; //absolute path
 
  std::cout << "\npath: " << img_path << "\n";
  return 0;
}

0개의 댓글