From 0a97cf5da44ef44246e17b257db4589fb9881b9c Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Tue, 25 May 2021 11:03:32 +0200 Subject: Refactor cleanup --- docs/ccommon_api.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index 93f46bf4..b4b548a8 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -20,10 +20,11 @@ The **c_forbuffer** uses stack memory if buffer is <= to 256 bytes, othewise it | `c_forbuffer (buf, type, n)` | Declare, allocate and free memory buffer | The `acquire`argument must be of the form: `type var = GetResource`. For multiple variables, use multiple -`c_forvar` in sequence, or if variables are of same type, the `c_arg` macro can be used: -``` +**c_forvar** in sequence, or if variables are of same type, the **c_arg** macro can be used: +```c c_forvar (c_arg(cstr s1 = cstr_lit("Hello"), s2 = cstr_lit("world")), cstr_del(&s1), cstr_del(&s2)) { + printf("%s %s\n", s1.str, s2.str); } ``` **Example**: Load each line of a text file into a vector of strings: -- cgit v1.2.3