diff options
| author | Tyge Lovset <[email protected]> | 2023-04-09 23:22:22 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-04-09 23:22:22 +0200 |
| commit | 680faa169dfc7e7d4fc7532922bf7103f8cdc279 (patch) | |
| tree | c37dcdb87850c9a008cfe6ddd7d0282a531b1279 /README.md | |
| parent | d717656f4728d3cbbc9ade1c314275334c62466d (diff) | |
| download | STC-modified-680faa169dfc7e7d4fc7532922bf7103f8cdc279.tar.gz STC-modified-680faa169dfc7e7d4fc7532922bf7103f8cdc279.zip | |
Added some online examples.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |
