用到过的C++技巧

来源:互联网 发布:网络教育学位 编辑:程序博客网 时间:2024/06/10 01:16
labelname=oneFacePath+".txt";ifstream f(labelname);cout<< labelname<<":"<<f.good()<<endl;#include <boost/algorithm/string.hpp>     // logging module#include <boost/algorithm/string/split.hpp>#include <boost/algorithm/string/classification.hpp>using namespace boost::algorithm;std::getline(f, line);split(tokens, line, is_any_of(" ")); // here it isstd::string::size_type pos_space;pos_space=line.rfind(" ");string class_label=line.substr(line.length()-pos_space-1);