Fixed size = "static arrays" indeed don't store any length info. It would be the same always.
Mind that you have
- static arrays
- dynamic arrays
- open arrays: procedure foo(openarray: array of word)
(yes same syntax, different type)
And yes you can take pointer to any array element, and the address the next array element by incrementing the pointer.
With pointer math enabledvar p: pword;
begin
p := @data[0];
inc(p); // next word in data / inc by the size of a word / because p is a typed pointer
Mind that "dynamic arrays" (sizeable arrays) are refcounted pointers, so passing them to a function only increases the refcount but does not copy them.
Static arrays are copied, and so are open arrays.
Except if you use "const" : procedure foo(const data: array of word);
"const" means that you can't edit the value.
"const" also means you must not change the variable that you passed in!