+ 2
Arrays in c++?
Ok, I was under the impression that arrays in c++ must have their size declared upon compile time. I was specifically told that I wouldn't be able to do this. Why does this code work? Were they wrong? https://code.sololearn.com/cf84ULuaG3Nc/?ref=app
2 Answers
+ 3
Did ask myself this question a while ago, thankfully a friend enlightened me that although this was possible, such ways ideally should be paired with use of dynamic array or std::vector.
IIRC such declaration of array isn't all too widely supported (compatible) with the most compilers family, if I understood correctly what my friend told me, that is : )
+ 2
I think this may have a relation:
https://en.m.wikipedia.org/wiki/Variable-length_array