I'm doing this on a NODEMCU 12E
My intention is to create an array of a known length by declaring the size of it
as the variable "bufferLength" so it is easy to change both size and do the
management of the array in an "elegant" way.
Before void setup() I do the following with different success
I would like to do it in this way:
But it does not work:
int bufferLength = 6;
int myCircularBuffer[bufferLength];
Nor this:
int bufferLength = 6;
int myCircularBuffer[bufferLength] = {0,0,0,0,0,0};
This works:
int bufferLength = 6;
int myCircularBuffer[6];
and this works:
int bufferLength = 6;
int myCircularBuffer[6] = {0,0,0,0,0,0};
Aaaahhh yes.
"array bound is not an integer constant before ']' token"
You are damned right. I just didn't understand that, but it is clear for me now.
Thanks a lot