TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: Neil Heller
from: Jasen Betts
date: 2003-08-05 17:24:36
subject: Re: This always drives m

Hi Neil.

 NH> What _really_ confused me was the thought that since

 NH> int IntArray[100];

 NH> is a pointer to 100 consecutive integers,

no, it's the address of 100 consecutive integers. a pointer is a variable
you can change the addreess it indicatees. an array has a fixed address

 NH> int * pIntArray = new int[100];

 NH> must be a pointer to a pointer to 100 consecutive integers.

 NH> Bzzzzt.  Wrong!

now it follows logically that this pointer indicates the address of 100
coonsecutive integers.

by "fixed address" above I mean the programmer can change the address.
if it's an auto (variable stored on the stack) with recursion etc different
instances of the array may have different addresses

 -=> Bye <=-

---
* Origin: Black Holes were created when God divided by zero! (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.