B
Bruce Wood
TS said:I was under the assumption that if you pass an object as a param to a method
and inside that method this object is changed, the object will stay changed
when returned from the method because the object is a reference type?
my code is not proving that. I have a web project i created from a web
service that is my object:
public class ExcelService : SoapHttpClientProtocol
{
public ExcelService(); ...
In my code in initialize the object varialbe to null and then pass it to a
method that instantiates it, but when the method returns the varaible is
still null
ExcelService es = null;
string sessionId = OpenSession(es);
es equals null here!!!!!
Yes is does. Your is a classic misunderstanding of the difference
between "pass reference by value" and "pass by reference". Read Jon
Skeet's article on parameter passing and pay particular attention to
that bit:
http://www.yoda.arachsys.com/csharp/parameters.html