Push_back with std::vector<sf::Vector2f> Vector

Hi there,
I would like to ask, how to push_back with a vector of the following type (don't know if it is specific to sfml?):

 
  std::vector<sf::Vector2f> UnitVector;



I've been trying so much combinations for some time now, but nothing seems to work. Thx in advance for any help.

Why doesn't something like this work:

 
UnitVector[0].push_back(10,10);
UnitVector is an array (std::vector) of sf::Vector2f's. UnitVector[0] is an sf::Vector2f.

sf::Vectors represent the mathematical vector, and not a dynamic array.
UniVector[0] is one sf::Vector, and doesn't have a function like push_back.

I believe you want
UnitVector.push_back(sf::Vector2f(10, 10));
Last edited on
Topic archived. No new replies allowed.