view test/cloop.c @ 882:3976dc54ec3d

fix Makefile
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 03 Apr 2014 17:52:05 +0900
parents 5313ed059cee
children d712ee10feb7
line wrap: on
line source

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 */