How can I push_back a struct into a vector?
push_back
struct
struct point { int x; int y; }; std::vector a; a.push_back( ???
point p; p.x = 1; p.y = 2; a.push_back(p);
Note that, since a is a vector of points (not pointers to them), the push_back will create a copy of your point struct -- so p can safely be destroyed once it goes out of scope.
a
p