I swear I saw a Jedi hand wave there, John... :^)
-----Original Message-----
From: John Marshall [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 7:45 AM
To: Palm Developer Forum
Subject: Re: allocating dynamic array of my structs
On Tue, Feb 25, 2003 at 07:22:22AM -0800, Brian Preston wrote:
> I need to create a dynamically-sized array of a struct
> that I've defined
[...]
> "You merely need to cast the pointer returned by
> MemPtrNew and assign it to a variable of type struct
> data*."
>
> struct data* myPointer;
> myPointer = (struct data*)MemPtrNew(sizeof(struct
> data));
(Close, but not quite. You'll find what's wrong in one of the
references below.)
> So would my array be an array of pointers instead? I
> was thinking my global variable would be a pointer to
> the first record in the array.
Some may say this response is rude, but the reality is that it is not.
The best possible advice you can get in response to your questions is
Go and read a book.
If you cannot quite imagine entering a bookstore or a library :-), you
might start with the C FAQ. Find it by typing "C FAQ" into Google.
Start at question 6.14, but because you are a curious programmer you
will find it hard to resist reading the entire thing.
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/
------------------------------------------
The information in this transmittal and any attachments are confidential and intended
only for the recipient(s) listed above. You are hereby notified that any unauthorized
distribution or copying of this transmittal or its attachments is prohibited. If you
have received this transmittal in error, please notify invivodata immediately at (831)
438-9550.
------------------------------------------
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/