:: Re: [DNG] Studying C as told. (For …
Top Page
Delete this message
Reply to this message
Author: karl
Date:  
To: dng
Subject: Re: [DNG] Studying C as told. (For help)
Irrwahn:
...
> [4] http://david.tribble.com/text/goto.html


As an mental exercise, look at part II in the above, and make programs
for if/while etc. with labels and goto's.

E.g. a general loop is

loop_init();
loop_start:
loop_pre();
if (condition()) goto loop_start;
else goto loop_end;
loop_post();
loop_end:

for a
while loop, init and pre are empty
for loop, pre is empty
do-while, init and post are empty

break is goto loop_end, continue is goto loop_start.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57