summaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-04-09 23:22:22 +0200
committerTyge Lovset <[email protected]>2023-04-09 23:22:22 +0200
commit680faa169dfc7e7d4fc7532922bf7103f8cdc279 (patch)
treec37dcdb87850c9a008cfe6ddd7d0282a531b1279 /README.md
parentd717656f4728d3cbbc9ade1c314275334c62466d (diff)
downloadSTC-modified-680faa169dfc7e7d4fc7532922bf7103f8cdc279.tar.gz
STC-modified-680faa169dfc7e7d4fc7532922bf7103f8cdc279.zip
Added some online examples.
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md
index 35431972..65d00324 100644
--- a/README.md
+++ b/README.md
@@ -173,6 +173,8 @@ int main(void)
}
```
You may switch to a different container type, e.g. a sorted set (csset):
+
+[ [Run this code](https://godbolt.org/z/qznfa65e1) ]
```c
#define i_type Floats
#define i_val float
@@ -181,9 +183,10 @@ You may switch to a different container type, e.g. a sorted set (csset):
int main()
{
- Floats nums = c_make(Floats, {30.f, 10.f, 20.f}); // Initialize with a list of floats.
- Floats_push(&nums, 50.f);
- Floats_push(&nums, 40.f);
+ Floats nums = {0};
+ Floats_push(&nums, 30.f);
+ Floats_push(&nums, 10.f);
+ Floats_push(&nums, 20.f);
// already sorted, print the numbers
c_foreach (i, Floats, nums)