Neil-
Oh... that's what you mean by dynamic.... Well, that's actually on the
stack (is there a better name for it than a 'stack variable'?), which is
only about 2-3.5k on the palm, depending on OS. Now it makes sense that the
13th allocation, which goes over 2k or so it crashing the palm. This looks
like a stack overflow problem. Try allocating the array like this:
Film* filmArray = new Film[Max_Film_Num];
This will create the film objects out of the dynamic heap as opposed to on
the stack. In the Palm world, you should try very hard not to put large
objects on the stack. The new operator on Palm is basically MemPtrNew().
Don't forget to explicitly delete the array as well...
Good luck,
Alan Pinstein
Synergy Solutions, Inc.
http://www.synsolutions.com
1-800-210-5293
>Hi,
>
>> For a total of around 200+ bytes. (Unless that "[500" at the end wasn't a
>> type for [50], but for [500], in which case I think the problem is
>> obvious. :-)
>
>Oops...that should have read [50].
>
>> First of all, what exactly is a "dynamic data structure, an array of..."?
>> A C++ pointer to an array allocation? A linked list containing object
>> pointers? Are these separate allocations, or one large allocation, etc.
>
>My app is a prototype of a visual film database; for each film in the data
>set
>there is a bitmap representing it on a scatterplot. I decided to try and
>use an
>array to hold the data, and each film is represented by the class Film.
>I have
>this declaration :
>
>Film filmArray[Max_Film_Num]; -- Max_Film_Num is whatever
>
>This is the data structure; I then have a function that is called that
>fills up
>the array with data when the app is launched. It worked fine when I was
>experimenting with a few films, but any data set greater than 13 crashes
>the app
>(I need 70 odds for a valid experiment).
>
>Is this data structure too big for memory? As I said before I don't know
>much
>about memory allocation etc. If it is too big is there any way around the
>problem?
>
>Any advice would be much appreciated,
>
>Neil