You can do it. I would keep the static array as small as possible. You can
always dynamically allocate the array and manage it within your library.
That way the OS can move the memory around as needed.
----- Original Message -----
From: "Brian Smith" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, April 16, 2004 8:02 AM
Subject: Re: Putting a constant array into a shared library
> On Fri, 16 Apr 2004, Tony Yat-Tung Cheung wrote:
>
> > So, what is the way to declare the lookup array as a const data
> > structure? Is it something like the following?
> >
> > char f(int n) {
> > static const char lookup[128] = {'A', 'B', 'C' ... };
>
> Should do it, yeah.
>
> > And it would also work in a shared library's implementation?
>
> Don't see why not. I have yet to write a shared library, but I've used
> that before with sublaunched apps, and for the same reason (no globals).
> It's worked perfectly in those cases.
>
> --
> -----------------------------------------------------------------------
> Brian Smith // avalon73 at caerleon dot us // http://www.caerleon.us/
> Software Developer // Gamer // Webmaster // System Administrator
> Life is full of surprises, but never when you need one. -- Calvin
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/