Jump to content

Parameter Passing: Difference between revisions

m
→‎Example [[C]]/[[C++]]: Missed some grammar
m (English, clarified formal and actual parameter)
m (→‎Example [[C]]/[[C++]]: Missed some grammar)
Line 26:
 
===Example [[C]]/[[C++]]===
[[C]] and [[C++]] use only by value parameter passing. Arguments are mutable as if they were in-out, but the compiler does not store the copies back. Results also passed by copy (copy out). Where by-reference passing is needed, the [[C]]/[[C++]] deploys [[reference|referential]] types ''T*'' and ''T&'' (in [[C++]]). So when an object of the type ''T'' needs to be passed by reference, another object of either the type ''T*'' or ''T&'' is passed by value instead. Because objects in [[C++]] can be automatically converted to the references, in many cases the difference is not noticeable.
 
===Example [[Fortran]]===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.