title: What's wrong with this C++ nested for loop?
body: <pre><code>for (int pixel = 0; pixel &lt; imgVector.size(); pixel++)
  {
      for (int x = 0; x &lt; image.getSize().x; x++)
      {
          for (int y = 0; y &lt; image.getSize().y; y++)
          {
              pulledImage.setPixel(x, y, sf::Color::Color(imgVector.at(pixel)));
              pixel++;
          }
      }
  }
  </code></pre>
  
  <p>So in this code I am trying to loop through a vector and place its contents into an image using SFML, but unless if I have pixel++; placed inside of the loop it gets stuck, I feel that having pixel++; in the loop is incorrect and could cause problems with my program. Any help is appreciated!</p>