#include<iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main(){
std::cout
<< fs::path( "/home/liao/test/Ti/model_zoo/ONR-OD-8050-ssd-lite-regNetX-800mf-fpn-bgr-coco-512x512").filename()
<< '\n';
return 0;
};
编译方法
g++ fifth.cpp --std=c++17 -lstdc++fs
结果
“ONR-OD-8050-ssd-lite-regNetX-800mf-fpn-bgr-coco-512x512”