The Empty Statement

The empty statement does nothing:

[Graphic: Figure from the text]

The empty statement can be useful as a place holder. For example, if a for statement contains all of the necessary functionality in its header, the body of the for statement can be the empty statement. Here's an example:

// Find the first element of array nx that equals 5 int x;
for (x = 0; x < nx.length && nx[x] != 5; x++) // for requires a statement here: use an empty statement ; if (x < nx.length) {
 // The for statement found a 5 at nx[x]
}