Lazyc/examples/da_from_array.c

16 lines
282 B
C

#include <stdio.h>
#include <stddef.h>
#define LAZY_IMPL
#include "../lazy.h"
int main() {
float xs[] = {1, 2, 3, 4};
Lz_DA(float) nums = {0};
lz_da_fill_from_array(&nums, xs);
for (size_t i = 0; i < nums.cnt; ++i) {
printf("%f\n", nums.data[i]);
}
return 0;
}