On Thursday 25 October 2001 01:06 pm, Microchip wrote: > I want to declare an array of strings like : > > const unsigned char Str1 [2][5] = {"Hello", "Bye "}; > > My problem is the compilator doesn't put the null caracter (\0) at end of > each string. That's because there are 5 characters in "Hello" and you didn't give it any room to put the NUL in . This suggestion won't work for the same reason: > Try this: > > const unsigned char Str1 [2][5] = {"Hello\0", "Bye \0"}; > > That should put an explicit NULL at the end of each string. The (const unsigned char str1[2][6]) should give you enough room as well as give you the NUL chars. But note that this will reserve space for 12 bytes; if you have a larger/sparser array than this it might make sense to have an array of char* (of course, the generated code may be somewhat slower because the PIC is bad at pointers): const unsigned char * const Str1[2] = { "Hello", "Bye" }; -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics