At 15:49 2007-02-03, Joseph A. Marrero wrote:
>This is one of the strage parts of C/C++. I thought
>array_name[idx] notation was syntactic sugar for the
>*(array_name + idx). The question is how different are they
>with respect to their layout in memory? Some would argue
>that they are not different at all except for whether they
>are on the stack or the heap. Maybe this is something I
>don't understand at all, but I believe both are arrays.
they're the same, period.
>--- Paul Herring <[EMAIL PROTECTED]> wrote:
>
> > On 2/3/07, Joseph A. Marrero <[EMAIL PROTECTED]>
> > wrote:
> > > I think sizeof will only work on statically allocated
> > > arrays. Consider the following:
> > >
> > >
> > > #include <iostream>
> > > using namespace std;
> > >
> > > int main()
> > > {
> > > int array_one[ 25 ];
> > > int *array_two = new int[ 25 ];
> >
> > array_two isn't an array, it's a pointer to an int. The
> > int it happens
> > to point to is the first item in an array.
> >
> >
> > --
> > PJH
> >
> > #706281 +(1868)- [X]
> > TriPod11: bush ain't THAT bad...he kinda knows what he's
> > doin
> > idaredbeet08: Please, Monica Lewenski had more President
> > in her than
> > George Bush ever will.
> >
>
>
>_________________
>Joseph A. Marrero
>http://www.l33tprogrammer.com/
>
>
>
>____________________________________________________________________________________
>Looking for earth-friendly autos?
>Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
>http://autos.yahoo.com/green_center/
>
>
>To unsubscribe, send a blank message to
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>
Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
"There oughta be a law"