What does the term "empty loop" refer to exactly in C and C++?

Answer is context dependent.

If you mean an empty for loop, then

 for(;;)
 {
     statements;
 }

is such a thing.

Although, the same thing can be achieved with a while loop:

while(true)
{
    statements;
}

and this isn't an "empty" loop. Both of these are infinite loops that you must break out of using break inside of your loop.

On the other hand,

for(initialisation;condition;updation)
{
}

this is an "empty" loop that bascially does nothing, except perhaps update some variables that could be defined before the loop itself.


In my environment it is like this:

for(;;) { statements; }

endless loop

for(initialisation;condition;updation) { } 

empty loop


Your first case (for with empty expressions) is an infinite loop and the second one (with empty body of the for statement) is an empty loop

Tags:

C++

C