--- Dinesh Kumar <[EMAIL PROTECTED]> wrote: > What is the correct way to implement Byte Array in PalmC ? > I'm a newbie, please help me out..
I'm not sure what PalmC is. If it is a C compiler that you are using to compile a program for Palm Powered devices, then // 1. an array of SIZE bytes UInt8 byteArray[SIZE]; or // 2. a pointer to SIZE bytes UInt8 * byteP; byteP = MemPtrNew(SIZE); Method 1 won't work for anything large unless it is a global variable because local variables are allocated on the stack and the stack is eally small on Palm OS devices. (Only 2 or 4KB -- I don't remember exactly). > I'm using UInt8 pointer and ,allocating it with some > memory then using MemMove to copy data on it then i > keep copying into the same bytearray at basepointer + some > values.. > here..Is there any maximum memory i can allocate to such byte Array? No single object can be bigger than 64KB on a Palm handheld. If you need something bigger than that, a file stream is probably the only way to do it. (Or, you can use feature memory if the OS is 3.5 or newer.) > becoz it allocatates only one byte! Post your code. If it only allocates one byte, you aren't doing it correctly. > ..only at debug mode when i see it as > char[256] ,then only it shows the further values.. > also while copying integers it works fine, but when i > start copying strings, it gives memory error at the > second string Post your code. What memory error do you get? What line of code is executing when you get that error? Not everyone here is psychic. :) __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
