65,211
社区成员
发帖
与我相关
我的任务
分享 vector<int> Int;
vector<double> Double(Int.begin(),Int.end());
#include<vector>
using namespace std;
int main(int argc, char* argv[])
{
vector<vector<int > > xx(10);
for(int i=0;i<10;i++){
xx[i].resize(10);
for(int j=0;j<10;j++)
xx[i][j]=j*i;
}
vector<vector<long> >& v = * reinterpret_cast<vector<vector<long> >* >( &xx ) ;
for(int i=0;i<10;i++){
for(int j=0;j<10;j++)
printf("%3d " , v[i][j]);
printf("\n" );
}
return 0;
}