Iterate through a C++ Vector using a ‘for’ loop
The reason why you don’t see such practice is quite subjective and cannot have a definite answer, because I have seen many of the code which uses your mentioned way rather than iterator style code. Following can be reasons of people not considering vector.size() way of looping: Being paranoid about calling size() every time in … Read more