Skip to content

Instantly share code, notes, and snippets.

@kelvin-fly
Created September 11, 2012 01:02
Show Gist options
  • Select an option

  • Save kelvin-fly/3695201 to your computer and use it in GitHub Desktop.

Select an option

Save kelvin-fly/3695201 to your computer and use it in GitHub Desktop.
the area of variable and static
#include <stdio.h>
void foo(void);
int b = 666;
int main()
{
foo();
foo();
printf("what!!\n");
foo();
return 0;
}
void foo(void)
{
static int i;
// int i;
printf("%d\n",i);
i = 777;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment