mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 10:50:05 +01:00
[SPCA] fix formatting errors, add notes
This commit is contained in:
@@ -5,7 +5,7 @@ A note of caution when using goto: It is almost never a good idea (can lead to u
|
||||
Where it however is very handy is for error recovery (and cleanup functions) and early termination of multiple loops (jumping out of a loop).
|
||||
So, for example, if you have to run multiple functions to set something up and one of them fails,
|
||||
you can jump to a label and have all cleanup code execute that you have specified there.
|
||||
And because the labels are (as in Assembly) simply skipped over during execution, you can make very nice cleanup code.
|
||||
And because the labels are (as in Assembly) skipped over during execution, you can make very nice cleanup code.
|
||||
We can also use \texttt{continue} and \texttt{break} statements similarly to \texttt{Java}, they do not however accept labels.
|
||||
(Reminder: \texttt{continue} skips the loop body and goes to the next iteration)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user