From 597b631b5ee65de4b199790cbd0be359acf794e7 Mon Sep 17 00:00:00 2001 From: adithyaanilkumar Date: Mon, 29 Jun 2020 09:42:53 +0530 Subject: [PATCH] added static --- C/static_type.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 C/static_type.c diff --git a/C/static_type.c b/C/static_type.c new file mode 100644 index 0000000..e5662a4 --- /dev/null +++ b/C/static_type.c @@ -0,0 +1,18 @@ +//static example + +#include + +void stat(void); + +void main ( ) +{ + int i; + for(i=1; i<=3; i++) + stat( ); +} +void stat(void) +{ + static int x = 0; + x = x+1; + printf("x = %d\n", x); +} \ No newline at end of file