vector如何使用struct?
宝码 2003-12-09 05:07:52 #include <iostream>
#include <vector>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct tagTest
{
string aa;
string bb;
};
int main(int argc, char *argv[])
{
tagTest tTest;
tTest.aa = "test";
tTest.bb = "test2";
vector<tagTest> vTest;
vTest.push_bak(tTest); //如何把tTest存入vTest里?
system("PAUSE");
return 0;
}