Hey guys
is this dynamic array ?
recently I remembered looking into this website's tutorial a year ago
and this is written in the dynamic array section
"Dynamic" typically means that you have manually allocated data from the global store (or "heap"). [small](There are other meanings to "dynamic" too. Just like "window".)[/code]
The differences between a dynamic array and a VLA are:
1. Who is doing the allocating
2. Where the memory comes from
3. What additional information comes with the allocation
From new/malloc()/etc:
1. You do the allocating/cleanup
2. The memory comes from the global heap
3. No additional information about the array
A VLA is different:
1. The compiler does the allocating/cleanup
2. The memory comes from the local store (stack space)
3. Array size/type/indexing information is included
The idea with a VLA is to be able to dynamically allocate a local array. The problem is that it isn't really a normal local array, and the compiler must jump through some interesting hoops to make it work. Some of those hoops don't work quite right.
For now, it is non-standard and somewhat glitchy, so avoid VLAs.