#Can i have a pointer to slice of fixed size from an array?

1 messages · Page 1 of 1 (latest)

velvet island
#

for example i have the following array:

const array: [256]u8 = @splat(0)

I want a function that works on chunks of 16 bytes from this array, something like this

fn myFunction(slice: *[16]u8) { ... }
...
myFunction(array[idx..idx+16]);

can i have this or must i use *[]u8 and hope the length is right

charred rain
#

array[idx..][0..16]