I've figure out that you can achieve that by slicing a slice
const std = @import("std");
fn runtimeNumber() u16 {
return 32;
}
fn func(b: [4]u8) void {
std.debug.print("{any}", .{b});
}
pub fn main() void {
var buf: [8096]u8 = undefined;
const n = runtimeNumber();
func(buf[n..][0..4].*);
}