Markus comment pointed me to this answer: the difference is in using the continue keyword.
In this case:
int _tmain(int argc, _TCHAR* argv[]) { int i = 0; do { ++i; _tprintf(_T("Iteration %d\n"), i); if (i < 30) continue; } while(0); return 0; }
you only get one iteration, while in this case:
int _tmain(int argc, _TCHAR* argv[]) { int i = 0; do { ++i; _tprintf(_T("Iteration %d\n"), i); if (i < 30) continue; break; } while(1); return 0; }
you get iteration 30 . Tested under VS2008.
source share