[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] gets strengen



Sune <sslug@sslug> wrote:

> Du kan opfatte den som en slags "constant pointer".

Siden du åbenbart nægter at finde den FAQ frem, har jeg klippet det
relevante spørgsmål/svar til dig denne gang. Jeg kan naturligvis
stadig ikke tvinge dig til at læse og forstå det, hvilket du åbenbart
er meget imod:

6.9:	Someone explained to me that arrays were really just constant
	pointers.

A:	This is a bit of an oversimplification.  An array name is
	"constant" in that it cannot be assigned to, but an array is
	*not* a pointer, as the discussion and pictures in question 6.2
	should make clear.  See also questions 6.3 and 6.8.


> Et array "eksisterer" faktisk ikke, det kompileren gør når du
> skriver fx. a[21], er noget i stil med: gå til adressen "a",
> incrementer med 21 til den adresse, aflæs værdien på den adresse.
> Derfor forstår jeg ikke din sætning "..gør dog ikke et array til en
> peger", hvilken variabel tænker du på når du siger "array"?

Hvis jeg sætter p=a og skriver p[21] så dannes anderledes kode end for
a[21]. Du har ret i, at et array i mange tilfælde *kan opfattes* som
en peger, men det gør dog ikke... etc.


Du har vist endnu ikke nævnt en misforståelse som ikke er forklaret i
Section 6, så jeg vil fortfarende foreslå dig at læse og forstå den.
Indtil da er yderligere diskussion vist frugtesløs.


Med venlig hilsen.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *