Re: memorize..

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 10/03/97


On Fri, 3 Oct 1997, Brian Williams - Nashak wrote:

-+I still can't figure out how to read/write a int * from the pfile.
-+What I'm trying to do is something like this:

Actually, you probably don't want to...I should have thought of
that in the first place.  I mean, you don't want to play with
pointers in a binary file.  So, actually, you might want to go
down to a one-dimensional, sized array.

To please Andrew, I'll say that you *can* use pointers in a
binary file; and there's actualy several ways to do it.  You can
save the size of the array to the file first, read that in, and
then create the dynamic array.  Or you can actually seek forward,
do some subtraction and a division (end_pos - start_pos / sizeof(int))
to get the number of records.  But, it's probably not worth the
trouble.  Just resort to a static integer array, and forget I ever
wasted your time with the dynamic array...:P~


--
Daniel Koepke -:- dkoepke@california.com -:-  [Shadowlord/Nether]
Think.


     +------------------------------------------------------------+
     | 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