Look up table variable initialization

Hi folks,

I have a look up table that was initialized as extern const unsigned char map[64][4]={...} and a range of possible values from 0 to 255

I need to add negative values, so was wondering what would be the most correct way to initialize it

extern const signed char map[64][4]={...}

or

extern const signed uint16_t map[64][4]={...}

The data on the table ranges from -150 to + 255.

Regards

extern const signed char map[64][4]={...} -> -127 to 128 extern const signed uint16_t map[64][4]={...} -> no negatives (0 - 65535)

try int16_t or (int or short) instead. It will allow you to have negative values and go up to +255.