On Monday, 1 July 2013 at 17:34:39 UTC, Damian wrote:
Isn't the buffer just an array with a fixed length?

No. A static array is just a block of memory (like in C), whereas a slice is a struct with a length and pointer to a memory block.

A ref slice would write to the length/pointer, which doesn't exist with a static array.

You can get a slice from a static array by putting [] on the end, but to be ref, you'll need a variable with the type "int[]" because then the length and pointers can be changed by the function that accepts it.

Reply via email to