typedef struct
{
int x;
int y;
}Point;
Point* p = new Point[3];
for (int i = 0; i < 3; i++)
{
p[i].x = i * 2;
p[i].y = i * 2 + 1;
}
vector<Point> vec(3); //vec一定要预留足够大才行
memcpy(&vec[0], p, sizeof(Point) * 3);