Global variable example

This commit is contained in:
Mert Gör 🇹🇷 2024-07-17 16:54:04 +03:00
parent a63bf1b143
commit 9292974a16
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F

16
c-basic/global_variable.c Normal file
View File

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