delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/25/04:48:47

Message-Id: <3.0.16.19971125104154.290fe38a@hem1.passagen.se>
Date: Tue, 25 Nov 1997 10:42:18 -0500
To: "Scott Warner" <swarnerx3 AT acadia DOT net>
From: Peter Palotas <blizzar AT hem1 DOT passagen DOT se>
Subject: Re: pointers &arrays[]
Cc: djgpp AT delorie DOT com
Mime-Version: 1.0

At 19.33 1997-11-24 -0500, you wrote:
>array == &array[0]
This is true.

>array == &array
This is NOT true. `&array' is a pointer to array, i.e. a pointer to the
pointer of the first element in the array.

>*array == array[0]
This is also true.

>*(array+n) == array[n]
And so is this.


>are all true given array[n].  In this case, sizeof(array) returns the size
>of the entire array, not array[0].  Are there other examples where this
>pointer notation fails?

I think that sizeof(array), would just return the size of a pointer, since
that is what it is, and not the size of the actual array.


-- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --

*****************************************************
* A brief description of DJGPP:                     *
* NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! *
*****************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019