Re: is it possible to use out and ref keyword together???



In 99.9% of cases. There are (rare) occasions when you genuinely intend to
reassign a reference that was passed in, and you can't (for some reason)
return the new reference in the return value.

But yes; in many cases "ref" on a reference type parameter is due to
misconceptions. In contrast, "out" is IMO becoming more mainstream and more
useful that "ref", largely due to adopting the TryGetValue and TryParse
signatures from the 2.0 classes.

Marc


.



Relevant Pages

  • Re: Passing arguements by reference
    ... but doSomething doesnt change p unless i use "ref"? ... reference, hence both p and q pointing to the same object, not to different ... don't use the ref keyword. ... void Execute() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Documentation suggestions
    ... > Ian> I think it would be very useful if there was reference (not just ... Lang ref as only for "language lawyers". ...
    (comp.lang.python)
  • Re: pass by reference
    ... focus has moved from insisting to use "by ref" in java-context ... independent of any other use of the word "reference" in a language. ... Just because Java-refs can be re-targetted by assignment? ... If Java had an operator to tell an Object ...
    (comp.lang.java.programmer)
  • Re: Texas TMS1232 Delta Sigma converters
    ... John Larkin writes: ... >>picked up between the transducer and the ADC I'm trying to eliminate. ... the reference problem is serious. ... We're using an Analog Devices Xfet ref, ADR421, ...
    (sci.electronics.design)
  • Re: different forms
    ... You can declare a static variable of the main form's type at the main ... You can pass a reference of the form that opens the second/third/etc form ... they are being copied always, exept when you pass them by ref), you don't ... If you want to pass vars that are not of a ref type, ...
    (microsoft.public.dotnet.languages.csharp)