Possible Duplicate:
gcc compile error: cast specifies array type
I want to check the difference in (int * ) and (int []). When I compile the following code, line one goes fine. But for line 2, my compiler gives the following error:
test.c:10: error: cast specifies array type
Can any one please tell me the meaning of this error and where have I erred?
#include<stdio.h>
void abc(int *a)
{
int i;
for(i=0;i<2;i++)
{
printf("%d",((int * )a)[i]); //(1)
printf("%d",((int [])a)[i]); //(2)
}
}
int main()
{
int b[2]={0,1};
abc(b);
return 0;
}