It is a statement that does nothing. Usually this would be pointless and could just be deleted, but there are times when approval is expected and you really don't want anything.
Sometimes you see this with cycles that cause side effects and therefore do not need a body:
int count = 0; while(isTheRightNumber(count++)) ;
Personally, I donโt like such code examples and impede practice, since they are usually more difficult to understand than loops that have free side effects. Using a set of empty curly brackets is clearer as it includes the corresponding comment, for example:
int count = 0; while(isTheRightNumber(count++)) { }
Another example is the pattern for using a for loop for infinite loop:
for(;;) {
essentially coincides with:
while(true) {
Servy source share