On Fri, 3 Oct 1997, Brian Williams - Nashak wrote:
>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;
That would be making an array of integers memorize[0] to
memorize[array_size - 1].
int *memorize = malloc(sizeof(int));
*memorize = ch->player_specials->saved.memorize;
But why use malloc() in this case? Looks like just
int memorize;
would serve you better, but don't know the context.
--
George Greer - Me@Null.net | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard
+------------------------------------------------------------+
| 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