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 7ecfbb5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
// And you'll see magic here
int i = a[1];
// You can access them as an ordinary array
printf("content: %d\n", i); // Prints 42. Happy ending.
```

0 comments on commit 7ecfbb5

Please sign in to comment.