I have an constant array like this:
const int foo[NUM] = {
9000,
4400,
620,
480,
1620
};
How can I create another const array that will do some math operations on the variables from foo? I tried this:
const int bar[NUM] = {
foo[0] / (DEFINE1* DEFINE2),
foo[1] / (DEFINE1* DEFINE2),
foo[2] / (DEFINE1* DEFINE2),
foo[3] / (DEFINE1* DEFINE2),
foo[4] / (DEFINE1* DEFINE2)
};
However this doesnt work, it returns errors:
Error 2 (near initialization for 'bar[0]'), for all elements
Error 1 initializer element is not constant, for all elements