From: Isaac Waldron Newsgroups: comp.os.msdos.djgpp Subject: Re: Addresses of arrays Date: Tue, 03 Mar 1998 16:51:32 -0500 Organization: The Computer Nerd Lines: 25 Message-ID: <34FC7B64.2265DCAD@lr.net> References: Reply-To: waldroni AT lr DOT net NNTP-Posting-Host: plym2-1.worldpath.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Noam Rotem wrote: > I try and try and try, and can't understand how come the address of an array is the same > as the address of the first cell of it. > > int Arr[SIZE]; > if (Arr==&Arr) printf("Well, I give up..."); > > I always thought the name of an array to act as a pointer to the first value. Am I wrong > somehow? > > Does this mean I can use scanf("%s",&Str)? (signature clipped) If my thinking is correct, then the following snippet should explain your problem: int array[SIZE]; *array = 1; //*array points to the first data element in the array array = 1; //this is not allowed, because you are trying to change the address of the first element of the array. //end code -- Isaac Waldron http://www.geocities.com/SiliconValley/Lakes/3574/index.html