push_back struct c++
struct point { // Our struct int x; int y; }; // How you would normally do it point mypoint = {0, 1}; a.push_back(mypoint); // OR define a constructor point make_point(int x, int y) { point mypoint = {x, y}; return mypoint; } a.push_back(make_point(0, 1));
Source: stackoverflow.com