I used my first goto statement today!
Why would I use the black art known as goto? Well, I had some code like this,
Code:
for (auto it = vec.begin(); it < vec.end(); ) {
for (int i=0; i<4; i++) {
if (t[i]) {
switch (x) {
case 23 :
/* needed to go back to iterating through my vector here */
}
}
}
}
Turns out, I completely forgot that 'break' will break you out of a switch before a loop so I just put a label or w/e before my int for-loop and omg, my code actually works properly now or at least, I have successfully replaced recursion with iteration.
Sorry, I just felt like sharing. goto's are actually pretty sweet. I'm going to needlessly fill my code with them from now on.