I want to defined an array, the length from a macro as below,
#define A (2.5)
#define B (2.0)
#define LEN (A*B) // I know LEN is an integer, not decimal numbers
static int array[LEN] // define an integer array, length is A*B=5
I have a compile check to guarantee that the LEN is an integer,
simply like build_assert( (int)LEN == LEN )
The compiler gives “size of array ‘array’ has non-integer type”, what is the best way to change it?
Thank you,
0