[Vala] Question regarding passing a strings as arguments to a method



The Vala tutorial says:
"*Parameter Directions* **

*A method in Vala is passed zero or more arguments. The default behaviour
when a method is called is as follows: *

   - *Any value type parameters are copied to a location local to the method
   as it executes. *
   - *Any reference type parameters are not copied, instead just a reference
   to them is passed to the method. *

*This behaviour can be changed with the modifiers 'ref' and 'out'.* "


*My question therefore is:*

- are strings passed by value or by reference to methods (by default).
- is it possible to pass a string by reference to a method (to avoid
duplication)

Serge.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]