Hi I'm writing some debug output with std::cout with this code:
EDIT: as suggested I added a std::flush on each cout and an std::endl on each iteration
int
index = 0,
size = vector.size();
for (iterate trough a vector)
{
std::cout << "Actual element: " << index+1 << "/" << size << std::flush;
...
if (bad element)
{
std::cout << " -> Bad Element" << std::flush;
}
std::cout << std::endl;
}
The bad element string appear only after the successive element, why? What am I missing?
Thanks a lot!