Automatic Pointer Dereferencing

Since dynamic array variables are pointers, one might expect to do a lot of pointer dereferencing when using dynamic arrays. For example, to access the fourth element of a dynamic array pointed to by DynamicArray, one might expect to write the following code:

(*DynamicArray)[4] = 0;

While this syntax is correct, it is also redundant; whenever VTS encounters the [ ] index operator, it automatically dereferences the variable being indexed. This makes the explicit dereferencing unnecessary, so that the above code can simply be written as:

DynamicArray[4] = 0;

By automatically dereferencing an array pointer under these circumstances, VTS makes accessing an element of a dynamic array look and behave just like accessing an element of a static array.

StaticArray[4] = 0;

Note: VTS only performs automatic dereferencing when an element is accessed with the index operator. In no other cases is a dynamic array automatically dereferenced.