Code:Code:#include<stdio.h> int main() { unsigned int rowIndex = 0; int nRow = -1; while (rowIndex < nRow) { printf("%d\n", rowIndex); rowIndex++; } return 0; }
Code:Code:#include<stdio.h> int main() { unsigned int rowIndex = 0; int nRow = -1; while (rowIndex < nRow) { printf("%d\n", rowIndex); rowIndex++; } return 0; }
nRow is converted to unsigned int, so it becomes the largest unsigned int value.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)