file scope example

This commit is contained in:
Mert Gör
2024-11-01 07:55:47 +03:00
parent a96533946f
commit 293bc9b7ec
2 changed files with 22 additions and 0 deletions

18
c-basic/file_scope.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
int a;
void foo()
{
a = 10;
}
int main ()
{
a = 20;
printf("%d\n", a); // a = 20;
foo();
printf("%d\n", a); // a = 10
return 0;
}