Question: How can I `push_back` a `struct` into a vector?

```
struct point {
    int x;
    int y;
};

std::vector<point> a;

a.push_back( ??? );

```

Answer: 
```
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.
We should use emplace\_back() for user defined data types such as structs.We can use it even with primitive data types as well.