initial import
[staff/goc4/2018bti7061.git] / c-3-libraries / examples / c-variables / global2.c
1 #include <stdio.h>
2 /* This function is extern and defined in file "external.c"
3 where the value myVar1 is also used as external variable.*/
4 void printVar(void);
5 int myVar1;
6 int myVar2;
7 int main(){
8 myVar1 = 10;
9 myVar2 = -1;
10 printVar();
11 myVar1 /=2;
12 myVar2 *=2;
13 printVar();
14 /* Output:
15 myVar1 =10
16 myVar2 =-1
17 myVar1 =5
18 myVar2 =-2
19 */
20
21 }