Does the statement "char c[numItems][maxItemSize];" actually compile for you? Normally, it's only something you can do with constants.
The statement "char c[20[30];" allocates a 600 byte area on the stack that you reference with the name 'c'. The fact that it is declared as a 20x30 array doesn't change the fact that it is simply an array of characters. It is not an array of 20 character pointers each pointing to a 30 byte area. If you say x = c[5][12], you get the character that is at offset (5*30+12). C/C++ will allow you to cast c (which is a char[][], or simply a char*) to a char**, but it does not make it a char**. A char** is a pointer to a pointer to a character, while c is simply a pointer to a character. You would like the array (however constructed) to persist. However, the array c exists as an auto on the stack and will 'go away' when the current function returns. Casting and retaining the address in a global variable does not make the space persist. I should say, that the space still exists on the stack, but it was only temporarily available to your function, and has since been used by countless other functions, so most likely does not contain what you originally placed there. For your purposes, you'll need to allocate space on the heap for 'list' and for a char* array to point to the entries found in 'list', and remember them somehow so you can dispose of them when no longer needed. An aside, the statement for "(j=0;j < strlen(list);j++)" is very inefficient. You are asking for the length of 'list' to be computed for every interation of the loop. Perform the strlen(list) outside of the loop. Or, better yet, use a pointer to move through 'list' and stop when you reach the '\0' character. -- yisdersomenimororsisasisdenderisorsis? Jeff Loucks -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
