@quzah
Of course everything must be re-compiled, this is not the problem. The problem is that the module with
Code:
value = index_table[i];
is used in other programs. If i change this module then all other programs which make use of this module also have to change. Alternatively they must branch which is also not desireable. I don't want to get into a discsussion about SW reuse but I do not have the freedom to change/edit anything I like.
@Deckard
Your response did make me think about what new functionality I wanted and if it could not be done inside a table.
Below is a simple example:
Orginal table
Code:
static const u8 index_table[] =
{
0x01,
0x02,
0x03,
}
However now I'd like to index into another table from this table based on the value of [i]. Something like:
Code:
static const u8* index_table[] =
{
new_index_table,
new_index_table,
new_index_table,
}
static const u8 new_index_table[] =
{
0x05,
0x06,
0x07,
}
so using
Code:
value = index_table[i]; //when i=2, value will equal 0x06
Hope this clarifies what I would like to do.
Thanks for the help.