On Thursday, January 30, 2003, at 02:49 PM, Jordon Marshall wrote:

I stripped this thing down all the way, now it just traverses the array. Yet
it still gives me Fatal Exception, only sporadically just like before, I am
really lost. By the way I initialize the last entry in the array as '\0' ,
also this array is declared and initialized in the same segment as the code.

char array_of_store_numbers[950][10] = {
"6489", "14280", "16496", "21374", "5006", "5186", "2666", "14262", "5332",
"15684",
"18058", "20938", "19158", "19952", "21375", "17387", "18045", "17755",
"19576", "20999", .......


while(array_of_store_numbers[counter][0] != '\0' && !found)
{
counter++;
}

Not having seen the 'earlier' help, I'm seeing this for the first time and it loooookss like the old chestnut, when is NULL not a NULL type of thing. *Exactly how* is the last entry declared, that would be useful to see.

If your compiler is clever and re-uses constant strings then this *might* be work BUT my gut reaction is that your test:

..[counter][0] != '\0'

is be the cause of your problems. It just isn't doing what you think it is, and want it to! The sequence '\0' is in fact a single character, value zero. It is NOT a string. If you have declared your final entry as "\0" then you have in fact declared a string that, while containing the value NUL(L?, sigh, still can't remember sometimes!) is nonetheless, still a string with a real, NON-ZERO memory address. The rest is history.

Sean Charles.


(It's dark in here, we at war yet...?)


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


Reply via email to