From 578531395ecbabd8179e31520c2832ac7d6d3765 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Thu, 27 Jul 2023 12:06:17 -0700 Subject: add dynamic typing example --- python/examples/zero_init/test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 python/examples/zero_init/test.c (limited to 'python/examples/zero_init/test.c') 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 + +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; +} -- cgit v1.2.3