Skip to content

Commit

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

```c
int *a = scary_new(sizeof(int));
```
See the LHS; it looks like an ordinary C array, but

```c
printf("length: %zu\n", scary_length(a));
```
they knows their length by themselves😱.
```c
scary_push(a, -1);
scary_push(a, 42);
```
You can push elements with automatic memory extension,
as much as you want.

And you'll see magic here:

```c
int i = a[1];
```
You can access them as an ordinary C array without any overhead😱😱.

```c
printf("content: %d\n", i);
```
Then it prints 42. Happy ending.

0 comments on commit 81f56e7

Please sign in to comment.