65,208
社区成员
发帖
与我相关
我的任务
分享
struct A
{
int x, y;
};
vector<A> vec;
vec.push_back({1, 2});
vec.push_back({4, 5});
for (auto a : vec)
{
std::cout << a.x << " " << a.y << std::endl;
}
vector<A *> vec;
vec.push_back(new A());
不是很明显?