[comp.lang.c] Difference between Pointers and Arrays

jmbj@grebyn.com (Jim Bittman) (03/03/90)

Could someone please help me, I'm sure this is a fundamental question,
but I can't seem to figure it out.  I am calling a library routine that
expects an address, it works when I declare the array, but not when I
allocate memory to a pointer.  I'm using Turbo C 2.0 and the large
Memory Model.

double x[256];
double *xp;
int i;
main() {
xp = farcalloc(256,8);
for i = 
  *(xp + i) = expression;
for i = 
  x[i] = *(xp + i);   /* I did this to verify xp set correctly */
LibRoutine(xp,...)    /* doesn't work */
LibRoutine(x,...)     /* does work */
}
Thanks for any help, mail would probably be better than cluttering the
net.  Jim Bittman, jmbj@grebyn.com