1. 程式人生 > >用到過的C++技巧

用到過的C++技巧

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 is std::string::size_type pos_space; pos_space=line.rfind(" "); string class_label=line.substr(line.length()-pos_space-1);