#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> a,b,c;
for (int i = 0; i < 3; i++)
{
a.push_back( i );
b.push_back( i + 3);
c.push_back(i + 6);
}
vector<int>* seq[3] = {&a,&b,&c};
vector<int>* curr = 0;
for (int j = 0; j < 3; j++)
{
curr = seq[j];
printf("%d\n", curr->at(0) );
printf("%d\n", curr->at(1));
printf("%d\n", curr->at(2) );
}
getchar();
}
对vector使用指针
最新推荐文章于 2024-07-27 23:32:27 发布