Vector push_back in while and for loops returns SIGABRT signal (signal 6) (C++) <p>I'm making a C++ game which requires me to initialize 36 numbers into a vector. You can't initialize a vector with an initializer list, so I've created a while loop to initialize it faster. I want to make it push back 4 of each number from 2 to 10, so I'm using an int named fourth to check if the number of the loop is a multiple of 4. If it is, it changes the number pushed back to the next number up. When I run it, though, I get SIGABRT. It must be a problem with fourth, though, because when I took it out, it didn't give the signal. Here's the program:</p> <pre><code>for (int i; i &lt; 36;) { int fourth = 0; fourth++; fourth%=4; vec.push_back(i); if (fourth == 0) { i++; } } </code></pre> <p>Please help!</p>