Home  >  Article  >  Backend Development  >  What is the function of continue in C language?

What is the function of continue in C language?

烟雨青岚
烟雨青岚Original
2020-07-02 17:21:2823196browse

The function of the "continue" statement in the C language is to skip the remaining statements in the loop body and go directly to the end of the loop to end the loop and forcibly execute the next loop. The continue statement only ends this loop, but does not terminate the execution of the entire loop; the break statement ends the entire loop process and no longer determines whether the conditions for executing the loop are established.

What is the function of continue in C language?

The function of the continue statement is to skip the remaining statements in the loop body and go directly to the end of the loop to end the loop and force the execution of the next loop.

In C, Java, and MATLAB languages, the general form of the continue statement is "continue;"

is used in C and C#.

Its function is to end this cycle. That is, jump out of the following unexecuted statements in the loop body, and continue to solve the loop conditions for the while loop. For the for loop program flow, the third part of the expression in the for statement header is then solved.

The difference between the continue statement and the break statement is:

The continue statement only ends this loop, but does not terminate the execution of the entire loop. The break statement ends the entire loop process and no longer determines whether the conditions for executing the loop are established.

What is the function of continue in C language?

Recommended tutorial: "C Language"

The above is the detailed content of What is the function of continue in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn