pointers to arrays

Robert Forsman thoth at beach.cis.ufl.edu
Thu Feb 16 23:33:42 AEST 1989


  OK, Gordon cross wants to take the address of an array, but not in
any normal way.  If E is an array (yes I know it's upper case but
that's what he used) the &E should return a pointer to an array.  My
question is "what will you use this for?"  Pointers are usually used
to modify things, and &E I believe would be used to modify the address
of the array since that's what E is (the address of the array).  YOU
CAN'T DO THAT!!!
  Arrays are solid, cast in stone, at least until you pop 'em off the
stack.  Now if you have a pointer D that happens to point to the top
of the array, SURE, &D, because you can modify D.  E is (during it's
lifetime) pretty much a constant and shouldn't be modified.  THAT's
why you can't do &E (try &4, it fails for probably the same reason.)

   THOTH out -

"There's more postings coming your way comp.lang.Cers so wait until
I'm done before you sue me."			- me.



More information about the Comp.lang.c mailing list