Graham Gilmore writes:
> On Wed, 30 Aug 1995, Daniel W. Burke wrote:
> > The code below is called every 5 seconds from comm.c
> > no matter what changes I make, it either crashes when it get's
> > called, or does nothing at all....
> >
> > ANY ideas or solutions would be wonderful... (or if you've
> > already have teleport rooms working, I'd love to see your
> > code, because as far as I can see, this code SHOULD work)
> >
> > void do_teleports(void)
> > {
> > struct char_data *vict, *next_v;
> > int i;
> > for (i = 1; i < NUM_TELEPORT_ROOMS; i++)
>
> Two things. Your exit condition and your i increment are
> reversed (causing i to increase without bound). Also, the first element
> of the array is 0, not 1. Try this:
> for (i = 0; i++; i < NUM_TELEPORT_ROOMS)
The initializer should start at 0, but he had the "for" statement
correct. The syntax in C is:
for ( <loop init> ; <loop test> ; <loop increment> ) { <loop body> }
which matches the original code posted.
\_\_\_ _/ \_\_\_ axis data: specializing in online system setup & design
\_ \_ _/ \_ \_ Edward Almasy almasy@axis.com
\_\_\_ _/ \_\_\_ President: Axis Data Proprietor: NineJackNine BBS
\_ _/ _/ \_ 608-256-5732 (voice) 608-256-5697 (data)
\_\_\_ _/_/_/ \_\_\_ 9jack9: on the bleeding edges of culture and technology
This archive was generated by hypermail 2b30 : 12/07/00 PST