Answer the question
In order to leave comments, you need to log in
Why does the Codevision "too many initializers" error occur?
Hello.
The code throws an error "too many initializers"
"too many initializers"
#define buffer_MAX 16
char buffer[buffer_MAX] = "0123456789ABCDEF";
#define buffer_MAX 16
char buffer[16] = "0123456789ABCDEF";
Answer the question
In order to leave comments, you need to log in
"It doesn't work like that, but it works like that" is, most likely, some kind of fiction and / or reticence. There is no difference between these two options.
Otherwise:
1. This initialization is correct in C and incorrect in C++.
2. The standard C compiler in CodeVision contains a known bug, due to which it refuses to accept this completely correct code. Although the error message is worded differently.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question