update
This commit is contained in:
parent
9292974a16
commit
e482e0e22b
@ -1,3 +1,9 @@
|
|||||||
|
2024-07-26 hwpplayer1 <hwpplayer1@debian>
|
||||||
|
|
||||||
|
* c-basic/C.pdf: Fonksiyonların Parametre Değişkenleri page 27
|
||||||
|
|
||||||
|
* c-basic/global_variable_2.c (main): global variable and local variable example
|
||||||
|
|
||||||
2024-07-17 hwpplayer1 <hwpplayer1@debian>
|
2024-07-17 hwpplayer1 <hwpplayer1@debian>
|
||||||
|
|
||||||
* c-basic/C.pdf: Global Değişkenlerin Faaliyet Alanı sayfa 26
|
* c-basic/C.pdf: Global Değişkenlerin Faaliyet Alanı sayfa 26
|
||||||
|
21
c-basic/global_variable_2.c
Normal file
21
c-basic/global_variable_2.c
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int a;
|
||||||
|
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
int a;
|
||||||
|
|
||||||
|
a = 10; // yerel a
|
||||||
|
printf("%d\n", a);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
a = 20; // global a
|
||||||
|
printf("%d\n", a); // 20
|
||||||
|
foo(); // 10
|
||||||
|
printf("%d\n", a); // 20
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user