I recently downloaded VS Code on a Mac and installed the C++ extension. For some reason, when I declare
int arr[]{ 0, 1, 1, 2, 3, 5, 8 };
in my main, as I always have, I get the error
error: definition of variable with array type needs an explicit size or an initializer
followed by
error: expected ';' at end of declaration
The exact same code runs on my VS Code on Windows. Does anyone know the problem I am having? For each loops also strangely do not work.
2.1m questions
2.1m answers
60 comments
57.0k users