This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: pointers &arrays[]
- To: "Jean-Philippe Chancelier" <Jean-Philippe dot Chancelier at cergrene dot enpc dot fr>, <gnu-win32 at cygnus dot com>
- Subject: Re: pointers &arrays[]
- From: "Scott Warner" <swarnerx3 at acadia dot net>
- Date: Sat, 29 Nov 1997 07:29:40 -0500
Thank you for this distinction. It's an excellent point to remember.
----------
> From: Jean-Philippe Chancelier
<Jean-Philippe.Chancelier@cergrene.enpc.fr>
> To: swarnerx3@acadia.net
> Subject: Re: pointers &arrays[]
> Date: Friday, November 28, 1997 5:07 AM
>
> >>>>> "Scott" == Scott Warner <swarnerx3@acadia.net> writes:
>
> Hello,
> My little contribution to array-pointers
>
> Scott> 1. Array names are equivelant to pointers in most cases
>
> Yes as long as you do not try to change the adress they point to.
>
> int *x ,y[10],j=20,z[10];
> f(x) or f(y)
> x[0] =10 ;
> y[0] = 20 ;
> ....
> But
> y= malloc(...); not valid
> y= x ; not valid
> y= &j ; not valid
> y=z ; not valid too
> so y acts like a pointer since it points somewhere
> but you can't change the adress where it points
> It's like a const pointer
>
> Jean-Philippe
>
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".