读书人

boost progress_display兑现进度条

发布时间: 2012-09-10 11:02:32 作者: rapoo

boost progress_display实现进度条

boost progress_display实现进度条

#include <vector>#include <boost/progress.hpp>#include <fstream>using namespace std;using namespace boost;int main(){    vector<string> v(100);    for ( int i = 0; i < 10000000; ++i)    {           v.push_back("abcd\n");    }       progress_display pd(v.size());        ofstream fs("./test.txt", ios::out );    vector<string>::iterator pos;    for ( pos = v.begin(); pos != v.end(); ++pos)    {           fs << *pos <<endl;        ++pd;    }       return 0;}





读书人网 >操作系统

热点推荐