Re: Defining a list of structs....

From: Jason Wilkins (fenix@IO.COM)
Date: 10/23/98


Jourge Fuzz Bush wrote:
>
> Well I really don't know what this is called but what I did was the
> following:
>
> struct obj_data *bodybagobjs[] =
> { { "\0" } }

> Well I did have NULL in there but when I put null in there it crashes my
> mud when ever someone dies. (When the bodybag is created given to the
> morgatition and then saved in this struct) But this one give out
> warnings about incompatible types. Anyone got any idea what I can put in
> there?
>

because this is a string type, maybe you meant '\0'

"\0" is a string that has a NUL character in it, so it is a character
array that looks like:

{ '\0', '\0' }

NULL is a pointer type, is this a pointer?

If the structure does not have a pointer then you want to use a plain old zero to initialize it.

{ { 0 } }

If it is a pointer, then use NULL to initialize it,

{ { NULL } }

If it is a string, then use "" to initialize it.

{ { "" } }

>         Thanks,
>         - Matt

--
           Phoenix -- President of The Artistic Intuition Company
       Caelius * Mirror Reflex * Runica * X-Domain * Infinite Realms
                          http://www.io.com/~fenix


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



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