Created
February 27, 2014 06:32
-
-
Save cceckman/9245426 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> | |
| int i = 0; // Static values are initialized to 0 according to C spec, this just makes it explicit | |
| int foo(){ | |
| i = i + 1; | |
| return i; | |
| } | |
| int main(){ | |
| int x; | |
| for(x = 0; x < 10; x++){ | |
| int z = foo(); | |
| printf("I have called foo %d times\n", z); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment