many of the posted answers may have been a bit confusing.

static Char **gStringsPtrArray = NULL;
is a "pointer to a pointer to a char". that's right. as you never did c or
c++ you dont know what a pointer is. that's why you maybe should get a book
or surf the internet for beginner lessons in c - that's where they show you
what "pointer" means.

in java you are used to simply use the class String for a string. in c a
string is an array of chars. that would be:
Java:
String abc = "abc";

C:
Char abc[4] = "abc";
or
char *abc = MemPtrNew(4);
StrCopy(abc, "abc");
//use your string, and dont forget to free it!
MemChunkFree(abc);

*abc points to the first character in the string, in this case "a" and the
string ends at the first occurence of "\0" - as we have nullterminated
strings.

now to have a list of strings for a listbox we need a stringarray, that
would be

Char abcdef[2][4] = {"abc", "def"}; //this may be easier understandable for
you
or
char **abcdef;
abcdef = MemPtrNew(2);
abcdef[0] = MemPtrNew(4);
abcdef[0] = "abc";
abcdef[1] = MemPtrNew(4);
abcdef[1] = "def";
// send the list to your listbox and dont free your pointerarray until the
list is deleted.
MemChunkFree(abcdef[0]);
MemChunkFree(abcdef[1]);
MemChunkFree(abcdef);


Markus Dresch (www.palmside.com)



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

Reply via email to