summaryrefslogtreecommitdiff
path: root/python/examples/zero_init/test.c
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2023-07-27 12:06:17 -0700
committerMatthew Sotoudeh <matthew@masot.net>2023-07-27 12:06:17 -0700
commit578531395ecbabd8179e31520c2832ac7d6d3765 (patch)
treea19666928bb0d8aa47c9c9135cd80268b124ec82 /python/examples/zero_init/test.c
parente29b2b00691b12ae70e97a072664bad073d81c4f (diff)
add dynamic typing example
Diffstat (limited to 'python/examples/zero_init/test.c')
-rw-r--r--python/examples/zero_init/test.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/examples/zero_init/test.c b/python/examples/zero_init/test.c
new file mode 100644
index 0000000..5db109a
--- /dev/null
+++ b/python/examples/zero_init/test.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+int set_xyz() {
+ int xyz = 1;
+ return xyz;
+}
+
+int foo() {
+ int xyz;
+ return xyz;
+}
+
+int main() {
+ printf("Foo return value: %d\n", foo());
+ set_xyz();
+ printf("Foo return value: %d\n", foo());
+ set_xyz();
+ printf("Foo return value: %d\n", foo());
+ return 0;
+}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback