"Mike Wahler" <> wrote in message
news:_eiAc.15239$ ink.net...
> "Douglas" <> wrote in message
> news: om...
> > Hi,
> >
> > What is the need for the inaccessible pointer address beyond the end of
an
> array?
>
> It's sometimes convenient when iterating through an array.
> But be sure not to try to dereference it.
>
BTW why the later sizeof (a) causes segmentation fault in the code below? I
guessed that if would have resulted still 5*sizeof (int). Now I just found
out that there really is difference between arrays and pointers that
matters

. Althought in practice I use arrays if the length is fixed and
just declare a pointer if I the number of elements varies runtime.
-Jyrki
int a[5];
int main(void){
printf("%i\n",sizeof(int));
printf("%i\n",sizeof(a));
realloc(a,10*sizeof(int));
printf("%i\n",sizeof(a));
}
-jyrki