Maybe this is a simple question, but I just couldn't figure it out. Can someone tell me how to place a constant variable into the specific ROM area? I would like to be able to set a constant value at a particualr ROM area and use a pointer to get it whenever I need it. Cheers, Tang
const unsigned char code *MyArray[NumberFruits] = {"apple,"banana","cherry"}; There's one occurrence of "code" in this definition, to the left of the *. That means it applies to the "unsigned char". So, this is a table of pointers (in RAM) that point to characters in code memory. If you want the pointers themselves in code memory, you need to specify that as well:
const unsigned char code* code MyArray...