[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] pass by reference



Svar til John,

jamen at bruge & på det sted du'r ikke. Det giver også en parse-error
hvis du prøver det. Hvis ikke compileren havde brokket sig ville
&parameter også være det sted i stakken hvor variablen befandt sig og
dermed ville data kunne være smadret straks efter funktionen var
returneret. Med *parameter får du adressen på variablen der hvor den
ligger i det kaldende program.

Søren


John Mørck Hansen wrote:
> 
> Søren H.Sørensen wrote:
> 
> > Jeg ved godt at det jeg skrev er imod c's syntax og jeg har brugt det
> > som du, Henrik, beskriver det mange gange. I min Linux-alder har jeg
> > bare et program der forlanger det der &. Der er mine strenge samlet i et
> > eksternt modul og det kan være jeg skal kigge de erklæringer efter i
> > sømmene en gang til.
> 
> Det er nok en god ide !!!
> 
> Jeg beskrev prototypen af funktionen !!!
> 
>    float* calculate_value( float *value );
> 
> Skiftes ud med:
> 
>    void calculate_value( float &value );
> 
> (John =;-)
> --
> Din sikre vej til en sikker backup løsning til dit netværk.
> http://www.adilock.dk/~john/
> http://www.adilock.dk


 
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] *