While working on an arduino project, I created some C++ code that does not compile. After understanding where it stops the essence of it is as follows:
const int xx[]={12,5};
void setup() {
// put your setup code here, to run once:
const int yy[]={12,5};
}
class aaaa{
//compilation stops here giving error too many intialiazers for 'const int[0]'
const int zz[]={12,5};
};
void loop() {
// put your main code here, to run repeatedly:
}
The question is why it does not compile giving error "too many intialiazers for 'const int[0]'. Should it behave like that ?
constglobal array indicates to me that you may be confused about whatconst int xx[]={12,5};means. What are you trying to achieve exactly?