summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-21 16:40:19 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-21 16:40:19 +0000
commit9c3e1b3c55c677206e6f70919f81484a7f0fe0c5 (patch)
treece63b0e071c2a7067e516de22585f3a29409ab5c /README.md
parenta1efe2cdde2237083ffff825f5b2dbb7442aa419 (diff)
Fix for #79
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 86018f7..aa773f4 100644
--- a/README.md
+++ b/README.md
@@ -422,12 +422,14 @@ println "You are {age} years old.";
Zen C allows manual memory management with ergonomic aids.
#### Defer
-Execute code when the current scope exits.
+Execute code when the current scope exits. Defer statements are executed in LIFO (last-in, first-out) order.
```zc
var f = fopen("file.txt", "r");
defer fclose(f);
```
+> To prevent undefined behavior, control flow statements (`return`, `break`, `continue`, `goto`) are **not allowed** inside a `defer` block.
+
#### Autofree
Automatically free the variable when scope exits.
```zc