17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Statements<br />

goto<br />

goto<br />

The goto statement cause an unconditional branch to the label.<br />

The syntax is:<br />

goto label;<br />

A label has the same form as a variable name, and is followed by a colon. The goto's<br />

are used sparingly, if at all.<br />

Example:<br />

goto loop;<br />

Also See: Statements<br />

label<br />

label<br />

The label a goto jumps to.<br />

The syntax is:<br />

label: stmnt;<br />

Example:<br />

loop: i++;<br />

Also See: Statements<br />

break<br />

break.<br />

The break statement is used to exit out of a control loop. It provides an early exit<br />

from while, for ,do and switch.<br />

The syntax is<br />

break;<br />

19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!