The below program gives me an error in the intialisation (*a)[5]=((*)[])&v;.
When I don’t type at that line then I’m still getting the error.
int main()
{
int v[10];
int **p;
int (*a)[5];
(*a)[5]=((*)[])&v;
printf("%d\n",*a);
printf("%d\n",sizeof(v));
return 0;
}
When you mean error, you probably refer to run-time error. int (*a)[5] is a pointer to an array of 5 ints, which is never initialized. However on the next line you try to dereference it. You should initialize ‘a’ before using it, you may be trying to initialize it with v but that’s not an array of 5 ints. If you were to redeclare v as int v[5] then a = &v should work.