I created an array with storage space allocation like:
int* geom = new int[50];
And I printed the "values" of geom from -1000 to 1000 and I expected to get "random" values since I haven't initalised any value of array to anything. However, I got a lot of zeros and random numbers at certain places of which values and positions stayed exactly the same after each compilation and execution.
`
...
value of geom[-2] :209
...
value of geom[43] :0
value of geom[44] :0
value of geom[45] :0
value of geom[46] :0
value of geom[47] :0
value of geom[48] :0
value of geom[49] :0
value of geom[50] :1041
value of geom[51] :0
value of geom[52] :1970037110
value of geom[53] :1718558821
value of geom[54] :1868916512
value of geom[55] :892689261
value of geom[56] :943333469
value of geom[57] :858993460
value of geom[58] :808858675
value of geom[59] :2570
value of geom[60] :0
value of geom[61] :0
...
value of geom[310] :60609
`
As you can see especially for the "negative side" I got only zeros and 209 for the [-2]. So it means it is not a random type of thing.
I would like to know is there a "default" constructor type of thing if we don't use std::fill_n to fill the values for our array? And if it exists how does it know which until which point should it fill the array since I got not-randomly distributed values in a range of 2000 cells.
I got random values for each execution and compilation when I declared an array like: int geom[50]
(Still there was a significant amount of zeros though)
I am using Ubuntu 18.04 by the way.