> I need to create an array to store 0 or 1.  How do I
> create an unsigned/signed integer array?  (Actually,
> any array-like vector capable of storing a binary data
> would be fine).

I'm going to assume you mean at runtime, as otherwise you'd
just do something like:   Int8 theArray[12];
and you'd have theArray[0] - theArray[11] defined.

At runtime, just do:

void someFunc(Int8 numElementsInArray) {
   Int8 *theArray;

   theArray = MemPtrNew(sizeof(Int8) * numElementsInArray);
   if (!theArray)
        freak out here

   // set your elements.  For example:
   theArray[0] = 1;
   theArray[1] = 1;
   ...
   theArray[numElementsInArray - 1] = 0;

   MemPtrFree(theArray);
}

To make it unsigned, just change Int8 to UInt8

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to