Mercurial > hg > CbC > old > device
changeset 846:ab4af28a1fa1
add cloop
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Dec 2010 11:29:26 +0900 |
parents | a97cd8b97434 |
children | d58ae69b11e4 |
files | test/cloop.c |
diffstat | 1 files changed, 57 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/cloop.c Mon Dec 06 11:29:26 2010 +0900 @@ -0,0 +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 j[] = {0,1,2,3,4,5,6,7,8,9}; +long long l[] = {0,1,2,3,4,5,6,7,8,9}; + +void +f(char *c,short *s, int *j, long long *l) +{ + int i; + for( i = 0;i<10;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("%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++) { + s[i] = i; + printf("\n"); + } + for( i = 0;i<10;i++) { + j[i] = i; + printf("\n"); + } + for( i = 0;i<10;i++) { + l[i] = i; + printf("\n"); + } +} + +int +main() +{ + f(c,s,j,l); + st(c,s,j,l); + f(c,s,j,l); +} + +/* end */