Mercurial > hg > CbC > old > device
changeset 849:d58ae69b11e4
merge cloop.c
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 02:00:01 +0900 |
parents | d9cd16896b4a (current diff) ab4af28a1fa1 (diff) |
children | beb59eb56bb4 |
files | test/cloop.c |
diffstat | 1 files changed, 41 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/test/cloop.c Sat Sep 24 01:58:27 2011 +0900 +++ b/test/cloop.c Sat Sep 24 02:00:01 2011 +0900 @@ -1,23 +1,57 @@ - +int printf(const char *,...); char c[] = {0,1,2,3,4,5,6,7,8,9}; short s[] = {0,1,2,3,4,5,6,7,8,9}; -int i[] = {0,1,2,3,4,5,6,7,8,9}; +int j[] = {0,1,2,3,4,5,6,7,8,9}; long long l[] = {0,1,2,3,4,5,6,7,8,9}; -main() +void +f(char *c,short *s, int *j, long long *l) { int i; for( i = 0;i<10;i++) { - printf("%d\n",c[i]); + printf("%d ",c[i]); + } + for( i = 0;i<10;i++) { + printf("%d ",s[i]); + } + for( i = 0;i<10;i++) { + printf("%d ",j[i]); } for( i = 0;i<10;i++) { - printf("%d\n",s[i]); + printf("%lld ",l[i]); + } + printf("\n"); +} + +void +st(char *c,short *s, int *j, long long *l) +{ + int i; + for( i = 0;i<10;i++) { + c[i] = i; + printf("\n"); } for( i = 0;i<10;i++) { - printf("%d\n",i[i]); + s[i] = i; + printf("\n"); + } + for( i = 0;i<10;i++) { + j[i] = i; + printf("\n"); } for( i = 0;i<10;i++) { - printf("%ld\n",l[i]); + l[i] = i; + printf("\n"); } } + +int +main() +{ + f(c,s,j,l); + st(c,s,j,l); + f(c,s,j,l); +} + +/* end */