Passing dynamic arrays
spir
denis.spir at gmail.com
Tue Nov 9 09:49:47 PST 2010
On Tue, 09 Nov 2010 07:42:13 -0500
"Steven Schveighoffer" <schveiguy at yahoo.com> wrote:
> I think of an array as a hybrid between a reference and a value type. The
> data is passed by reference, the length is passed by value. This mean
> changing the length only affects the local copy, but changing the data
> affects all arrays that point to that data.
The pointer is passed by value as well. Thinking at an array as a fat pointer, a (pointer,length) tuple, well, the whole tuple is a plain value.
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
More information about the Digitalmars-d
mailing list