Mercurial > hg > CbC > CbC_gcc
annotate CbC-examples/test04.c @ 118:fd00160c1b76
ifdef TARGET_64BIT
author | mir3636 |
---|---|
date | Tue, 27 Feb 2018 15:01:35 +0900 |
parents | 4c6926a2b9bc |
children | 5d30d517ebed |
rev | line source |
---|---|
16 | 1 |
2 int test01(int a, double b, int *c){ | |
3 return a+b- *c; | |
4 } | |
5 | |
6 int test(int *a, double b){ | |
7 int c; | |
8 c = *a*b + 10; | |
9 printf("a = %x, *a = %d, b = %d\n", a, *a, b); | |
10 *a = test01( *a+b, 0.02, &c); | |
11 return *a+b; | |
12 } | |
13 | |
14 | |
15 int test02(int a, int b){ | |
16 int i,sum=0; | |
17 i = a; | |
18 while ( i <= b ) { | |
19 sum += i; | |
20 i++; | |
21 } | |
22 return sum - a*b; | |
23 } | |
24 | |
25 int main(int argc, char **argv){ | |
26 int a=10; | |
27 | |
28 printf("= %d\n", test02(0, 10)); | |
29 test( &a, 10.1); | |
30 return 0; | |
31 } | |
32 | |
33 |