You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hiden
```c
// rarray_fast_set, rarray_fast_get
struct point {
int x, y, z;
};
struct rarray array = { .size = sizeof(struct point), .base = NULL };
int len = 16;
// you could also call `rarray_grow()` to increase "capacity" only
rarray_setlen(&array, len);
struct point *ptr = rarray_fast_get(&array, struct point, 0);
for (int i = 0; i < len; i++) {
*ptr++ = (struct point){ i, i, i };
}
for (int i = 0; i < len; i++) {
struct point *ptr = rarray_fast_get(&array, struct point, i);
assert(ptr->x == i && ptr->y == i && ptr->z == i);
}
rarray_discard(&array);
```