#include
#include
#include
using namespace std;
struct person
{
string name;
string age;
person(string _n, string _a)
:name(_n),age(_a)
{}
};
int main(void)
{
vector P;
//push_back先创建再添加
person temp("mary", "15");
P.push_back(temp);
//emplace_back直接写参数添加元素
P.emplace_back("jack", "14");
for (int i = 0; i < P.size(); ++i)
cout << P[i].name << " " << P[i].age << endl;
system("pause");
return 0;
}