+ 2
Blank size
if we omit the size of an array int a[]; does it give error?? coz , in c language it does give error.
2 Antworten
+ 3
This is one of those I'd just try :)
Error: storage size of 'a' is not known.
The compiler has to know how much space to allocate because it goes in a specific segment during bootstrap (start up) of the compiled binary. This is not a c/c++ thing...it's an OS thing.
To get around this, one option is dynamic allocation.
0
It gives error in compiled languages using static arrays, you should make dynamic arrays or vectors
It doesn't in some scripting languages where arrays are always dynamic, like JavaScript.