Re: memorize

From: Brian Williams - Nashak (bmw@EFN.ORG)
Date: 10/03/97


> It would be treated as an integer except for two things:
> A) You have to allocate memory for it.  ie. malloc(sizeof(int))
> B) You have to use the * operator to get the value.
>
> The pointer concept carries over since a char * is just an array of char's
> anyway (null terminated).
>
> --
> George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity> http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard
>

How would I allocate memory for it and set the value to another pointer,
i.e.:
  int *memorize = realloc(memorize, sizeof(int)*array_size);
  *memorize = ch->player_specials->saved.memorize;

hence, saving the array to pfile, and being able to read it at any time in
the function without using the char file until you want to write it.


       /-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=X=-=-=-=-=-=-=-=-=-=-=-\
       |  Brian M. Williams          | 02/02/83 | bmw@efn.org          |
       X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=X
       | Boccob the Uncaring, Lord of All Magic | Nashak Stonehand     |
       | accolademud.hermesnet.net 5000         | coyote.toon.org 6000 |
       \=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X-=-=-=-=-=-=-=-=-=-=-=/


     +------------------------------------------------------------+
     | 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/08/00 PST