In this code
std::vector<int> vec;
for (int i = 0; i < vec.size() - 1; i++) {
std::cout << "Print" << std::endl;
}
Though vec
has no input members so the for
loop should not execute at all since i
will be more than the condition for execution which is vec.size() - 1
.
But still the loop is executing.