Re: Removing old items

From: Del (caminturn@earthlink.net)
Date: 08/06/01


NeoStar wrote:
>
> > > >   if (IS_CORPSE(obj)) continue;
> I'm just wondering... I see that command CONTINUE and I was wondering what
> the difference between using that and RETURN is? Couldn't it be:
> if (IS_CORPSE(obj))
>     return;
> Sorry I'm new to programming in C :)
>

Before the floods of "Buy a book" messages come flying in:

From "C for Dummies"
The return keyword is used to send a value back from a function, to return a
value from the fucntion.
The something is optional. return(); by itself to cause the program to return
in the middle of something.

From "Teach Yourself C, second edition"
The continue statement is somewhat the opposite of the break statement.
It forces the next iteration of the loop to take place, skipping any code in
between itself and the test condition of the loop.


So, for code that would clean a zone of objects. If you loop through
the objects in the mud to see if it is in a zone that you want cleared
then you have a loop. IS_CORPSE(obj) then you want to skip extracting it
and "continue" with the loop.


Next newbie question coding question:
For 100 points --
Explain what each of these printf conversion characters mean:
1. %c
2. %d
3. %e
4. %f
5. %g
6. %i
7. %o
8. %s
9. %u
10. %x

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST