view test/call.c @ 384:5fc059f1947d

ARM continue...
author kono
date Wed, 21 Jul 2004 13:52:13 +0900
parents 096559f07a70
children 0c256ea2a97e
line wrap: on
line source


int
a0(int i);

int (*conv)(int);

a0(int i)
{
    return i+3;
}

a1(int i)
{
    return i-3;
}


a2(int i,int conv(int))
{
    return conv(i);
}

a3(int i,int (*conv)(int))
{
    return conv(i);
}

a4(int i,int conv(int))
{
    return (*conv)(i);
}

a5(int i,int (*conv)(int))
{
    return (*conv)(i);
}

main(int ac,char *av[]) {
    int j,k;
    conv = a0;
    j = conv(3);
    k = a2(4,a1);
    printf("6 1 = %d %d\n",j,k);
    k = a3(4,a1);
    printf("6 1 = %d %d\n",j,k);
    k = a4(4,a1);
    printf("6 1 = %d %d\n",j,k);
    k = a5(4,a1);
    printf("6 1 = %d %d\n",j,k);
    return 0;
}