summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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