Sorry for the dumb question (I'm a total C++ noob), but what does
int x[101010];
declare? Is it list, a vector et cetera? And what is the meaning of 101010? I have never seen a declaration like this.
Sorry for the dumb question (I'm a total C++ noob), but what does
int x[101010];
declare? Is it list, a vector et cetera? And what is the meaning of 101010? I have never seen a declaration like this.
At block scope, int x[101010];
declares a uninitialised array with 101010
elements.
At global scope, the effect is similar but the elements are set to 0
.
Note that if you had written int x[010101];
, then you would have created 4161
elements as a leading 0
denotes an octal literal in C++.
In C++, a good rule of thumb is to use a std::vector
unless you have a good reason not to.