| ||||||||
Technical Support Support Resources Product Information | C166: VARIABLE ORDERINGQUESTIONI need help with the "Keep Variables in Order" option for the C166 Compiler. I have the following declaration:
const unsigned char serialNumDelimeter[6] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55};
const volatile long serialNum = SERIAL_NUMBER;
I expected serialNum to immediately follow serialNumDelimeter in the address space, but this is not the case. In fact, they are reversed. Why is that? ANSWERVariable ordering only works with variables, not constants. A solution is to incorporate the constants into a data structure in the proper order. Last Reviewed: Monday, June 07, 2004 | |||||||
| ||||||||