求在线帮助centos下安装最新boost库 100
求大神远程帮助安装boost库,试过网上一些安装方法都没奏效。求qq远程协助,请留下qq。能够运行简单程序即可。#include<iostream>#include<ss...
求大神远程帮助安装boost库,试过网上一些安装方法都没奏效。求qq远程协助,请留下qq。能够运行简单程序即可。
#include <iostream>
#include <sstream>
#include <string>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <vector>
#include <boost/serialization/vector.hpp>
#include <fstream>
using namespace std;
using namespace boost::serialization;
using namespace boost::archive;
int main()
{
vector<int> v;
for(int i=0;i!=12;i++)
{
v.push_back(i);
}
ofstream os("file",ios::out);
text_oarchive oa(os);
oa<<v;
os.close();
ifstream is("file",ios::in);
text_iarchive ia(is);
vector<int> vr;
ia>>vr;
is.close();
for(size_t i=0;i!=vr.size();++i)
cout<<vr[i]<<endl;
return 0;
} 展开
#include <iostream>
#include <sstream>
#include <string>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <vector>
#include <boost/serialization/vector.hpp>
#include <fstream>
using namespace std;
using namespace boost::serialization;
using namespace boost::archive;
int main()
{
vector<int> v;
for(int i=0;i!=12;i++)
{
v.push_back(i);
}
ofstream os("file",ios::out);
text_oarchive oa(os);
oa<<v;
os.close();
ifstream is("file",ios::in);
text_iarchive ia(is);
vector<int> vr;
ia>>vr;
is.close();
for(size_t i=0;i!=vr.size();++i)
cout<<vr[i]<<endl;
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询