65,186
社区成员




#include "stdafx.h"
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
typedef struct tagItem{
string name;
int value;
}Item;
typedef struct tagSum{
string name;
vector<int> vec;
}Sum;
Item items[] = {
{"he", 1},
{"he", 4},
{"he", 7},
{"wang", 2},
{"wang", 5},
{"wang", 8}
};
// 需要生成两个对象。
// Sum sum1 = {"he", [1,4,7]};
// Sum sum2 = { "wang", [ 2,5,8 ]}
int _tmain(int argc, _TCHAR* argv[])
{
Sum sum;
printf("press a key to exit\n");
_getch();
return 0;
}
map<char*, int*> items;
int arr1[] = {1, 4, 7};
int arr2[] = {2, 5, 8};
items.insert(make_pair<char*, int*>("he",arr1));
items.insert(make_pair<char*, int*>("wang",arr2));