Hello,
Im looking at this weird little code fragment I stumbled upon the other day
and I cant figure out how it works.
OK, I get the picture how the array is filled up to the fourth index, but that descending part is evil. And weird. :)
#include<stdio.h>
int main(void)
{
int p[10];
int i;
for(i=0;i<10;i++)
{
p[i]=9-i;
printf("%d",p[i]);
}
printf("\n");
for(i=0;i<10;i++)
{
p[i]=p[p[i]];
printf("%d",p[i]);
}
getchar();
return 0;
}