[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: [PROGRAMMERING] Performance: C contra ADA



On Wed, 03 Mar 2004 00:30:18 +0100
Michael Rasmussen <sslug@sslug> wrote:

> Øh, nu kan det godt være, der er noget, jeg har misforstået, men er
> pass-by-reference ikke lig med, at man overfører adressen på en
> parameter? 

Ja, det er rigtigt... men det har ikke noget med en pointer at gøre!

> I så fald hvad gør man så, når man i C overfører en
> pointer som reference, eller eksplicit angiver, det er parameterens
> adresse: 

For lige at sætte tingende helt på plads:

  1) En pointer en en variabel vis værdi indeholde hukommelses adressen
     på en anden variabel. Der af navnet pointer (peger). Når en pointer
     overføres til en funktion bliver pointer variablen overført som
     pass-by-value. Altså der bliver lavet en kopi af denne variabel.

  2) Reference er et alias for samme adresseområde. Det vil sige at
     variablerne har forskellige navne men deler det samme
     hukommelseområde. Så med pass-by-reference bliver der ikke kopieret
     noget. Der bliver "bare" oprettet et nyt navn for samme
     hukommelseområde (compiletime).


(John =;-)
-- 
Husk lige at tage backup af alle maskinerne på dit/jeres netværk !!!
http://www.adilock.dk/albackup/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 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] *