+ 2
Code breaks when running
This code crashes / exits out when running. I suspect a vector out-of-bounds logical error. Can you guys help me fix it? ( Well if you have a SFML compiler ofc ) https://sololearn.com/compiler-playground/cNXx0QIpQ4R6/?ref=app
1 Respuesta
0
Nvm I found out why;
I needed to initialize the vectors:
std::vector<std::vector<int>> lifeT(TRAIL_LENGTH);
std::vector<sf::Vector2f> vel(NUM_OF_SNAKES);
And
std::vector<std::vector<sf::Vector2f>> rPos(NUM_OF_SNAKES);