Created
May 12, 2017 03:33
-
-
Save shivabhusal/c82bee98b4432e5390df4db928a299f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include "../cspec/cspec.c" | |
| int * some_function(){ | |
| static int fun_call_counter = 0; | |
| fun_call_counter++; | |
| return &fun_call_counter; | |
| } | |
| void main(){ | |
| // `fun_call_counter` is not accessible here yet. And it does not make sense to even think about it | |
| // because you cannot use that var `fun_call_counter` by name. | |
| printf("the function is called %d times\n", *(some_function())); | |
| printf("the function is called %d times\n", *(some_function())); | |
| printf("the function is called %d times\n", *(some_function())); | |
| printf("the function is called %d times\n", *(some_function())); | |
| printf("the function is called %d times\n", *(some_function())); | |
| printf("the function is called %d times\n", *(some_function())); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment