Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Sep 20, 2024
1 parent bca3e1e commit ed02b49
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
libscary: An (scary) scalable array library in C
================================================

```c
int *a = scary_new(sizeof(int)); // See LHS; it looks like an ordinary C array
printf("length: %zd\n", scary_length(a)); // but knows their length by themselves
scary_push(a, -1); // You can push elements with automatic memory extension
scary_push(a, 42); // as much as you want
int i = a[1]; // And you'll see magic here! You can access them as an ordinary array
printf("content: %d\n", i); // Prints 42. Happy ending.
```

0 comments on commit ed02b49

Please sign in to comment.