Re: [Code] Problem!

From: Josh B. (beavis@netins.net)
Date: 12/17/96


On Tue, 17 Dec 1996, Jack Wilson wrote:

First of all, if you are going to reply with stupid ass answers, don't
answer.  I even said in the message it was probably something simple that
I was missing, and it was.  I got it figured out before you even sent this
message.  

> Josh B. wrote: 
> Yes, get a C book and find out what the number of the first element of
> an array is.  Until you learn C, you will continue to encounter bizarre
> problems like this one that you can't possibly solve without outside
> help.
> 
> >This is in the interpreter.c file right as a new character logs on...
> > 
> >for (k=1;k <=13;k++) {
> > obj=read_obj(newbie_eq[k], REAL);
> > obj_to_char(obj, d->character);
> >}
> > 
> > It crashes as soon as they press 1 to enter the game.  Here is my
> > newbie_eq array if you need it.
> > 
> > int newbie_eq[13] = {3043, 3076, 3081, 3086, 3071, 5424, 5426, 5427
> >                      12008, 3020, 7908, 3104, 3032};
> 
> Besides, this code is not robust.  Replace with:
> 
> for (k=<the magic number which you'll have to find out for yourself>;
>      newbie_eq[k] >= 0; k++) {
>    obj = read_obj(newbie_eq[k], REAL);
>    obj_to_char(obj, d->character);
> }
> 
> ...
> 
> int newbie_eq[] = {3043, 3076, 3081, 3086, 3071, 5424, 5426, 5427
>                    12008, 3020, 7908, 3104, 3032, -1};
> 

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST