Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //++++++++++++++
- // main.cpp
- //++++++++++++++
- #include <stdio.h>
- int foo();
- extern int i;
- ///////////////////////////////////////////////////////////
- int main()
- {
- for(; i < 9; i++)
- {
- printf("foo returned %d \n", foo());
- }
- return 0;
- }
- //++++++++++++++
- // f1.cpp
- //++++++++++++++
- static int i = 0;
- ///////////////////////////////////////////////////////////
- int foo()
- {
- static int n = 1;
- n ++;
- return n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement