scope examples
This commit is contained in:
19
c-basic/global_scope.c
Normal file
19
c-basic/global_scope.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
|
||||
a = 10;
|
||||
|
||||
{
|
||||
int a;
|
||||
|
||||
a = 20;
|
||||
printf("%d\n", a); // 20
|
||||
}
|
||||
|
||||
printf("%d\n", a); // 10
|
||||
|
||||
return 0;
|
||||
}
|
@ -3,9 +3,7 @@
|
||||
void foo()
|
||||
{
|
||||
int a;
|
||||
{
|
||||
int a;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
|
Reference in New Issue
Block a user