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 a32ca25
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
libscary: An (scary) scalable array library in C
================================================

This is one of those rotten dynamic array libraries, but wait, just take a look.

```c
int *a = scary_new(sizeof(int));
```
Look at this 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 a32ca25

Please sign in to comment.