Almost all languages have a foreach loop or something similar. Does C have one? Can you post some example code?
Eric's answer doesn't work when you're using "break" or "continue".
This can be fixed by rewriting the first line:
Original line (reformatted):
for (unsigned i = 0, __a = 1; i < B.size(); i++, __a = 1)
Fixed:
for (unsigned i = 0, __a = 1; __a && i < B.size(); i++, __a = 1)
If you compare it to Johannes' loop, you'll see that he's actually doing the same, just a bit more complicated and uglier.