I try to compile the following code with gcc and C++11 enabled:
gcc
C++11
unsigned int id = 100; unsigned char array[] = { id % 3, id % 5 };
You may use:
unsigned char array[] = { static_cast(id % 3), static_cast(id % 5) };