Dear all;
When i illustrate the diff. between 2D Array and pointer to pointer,
i illustrated that by another meaning that is{"Hi,The difference between
pointer to pointer and 2D Array is that:
First 2D Array:The 2d Array is used -often-for tables for ex:int
A[3][2] this means that this has 3 rows and 2 coloum you can imagine
that
second pointer to pointer:we know that the pointer is used to hold the
address the pointer to pointer is used to hold the address of another
pointer ex:int**x;"} this is the same as you explained as when i said tables of
rows and columns this means pointer to pointer as <int A[m][n];>the row ith
will have n columns which means pointer to pointer"
and you must have a sense as the sender of this message is -often- a beginner
so i explained it in a natural language not a programming or high level
language or concepts of 'c' language but the same meanning
thanks;
Eng A.Mahmoud
eng_hamada2585@ yahoo.com
eng.hamada2585@ gmail.com
OR
send your asks to
ah_...@yahoogroups. com
http://sites. google.com/ site/eng7amadapr ogramming/
http://tech. groups.yahoo. com/group/ eng_7amada_
for_programming_ works/
--- On Mon, 5/11/09, Michael Comperchio <[email protected]> wrote:
From: Michael Comperchio <[email protected]>
Subject: RE: [c-prog] Difference b/w pointer to pointer and 2D arrays
To: [email protected]
Date: Monday, May 11, 2009, 11:43 PM
But it's not an analogy. It's the assembler that's produced. Check it
out. C
is about bit's and bytes, not "strings" and Data.
Michael
_____
From: c-p...@yahoogroups. com [mailto:c-p...@yahoogroups. com] On Behalf Of
Paul Herring
Sent: Tuesday, May 12, 2009 12:42 AM
To: c-p...@yahoogroups. com
Subject: Re: [c-prog] Difference b/w pointer to pointer and 2D arrays
On Tue, May 12, 2009 at 5:34 AM, Michael Comperchio <mcmp...@gmail.
<mailto:mcmprch% 40gmail.com> com> wrote:
> The compiler will generate access code that looks something like this for
> multidimensional array access:
>
> *(*(level1 + n) + n)...
Hardly. If you're after an analogy which is more likely to be
implemented, try the simpler (assuming base[x][y]):
*(base + x times width +y)
Which involves no redirection with arrays of pointers and only one
dereference, all in a flat memory structure.
--
PJH
http://shabbleland. <http://shabbleland. myminicity. com/com>
myminicity.com/ com
http://www.chavgang <http://www.chavgang s.com/register. php?referer= 9375>
s.com/register. php?referer= 9375
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]