I use a AT89S52 and programming with KEIL C51.How can I implement a look-up table for string ? My array example : array[0] = "ABC" array[1] = "Hello" array[2] = "Good morning" array[3] = "Good night"
Hi I need to setup look-up table for string of day like this const char DayStr[7] = {{"Sunday"}, {"Monday"}, . . {"Saturday"}}; function Int2Day(unsigned char day) { return DayStr[day]; } Thank again
Do you understand how 'C' handles strings? Do you understand how to define a function in 'C'? These are basic 'C' issues - nothing specifically to do with the Keil tools. You need to study a 'C' textbook. Hint: 'C' does not have a function keyword - that's Pascal!
Try const char *DayStr[7] = {{"Sunday"}, {"Monday"}, . . {"Saturday"}}; Or a 2 dimentional array.