passing a class as an out parameter

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I have a class with several public member variables which I pass to a
library function as an "out" parameter. I noticed that when the
function returned, all the data was "lost". Do classes used in this
fashion need some kind of "clone" method much like the c++ copy
constructor to move the data back to the calling method properly?

Thanks,
Jim
 
Jim said:
I have a class with several public member variables which I pass to a
library function as an "out" parameter. I noticed that when the
function returned, all the data was "lost". Do classes used in this
fashion need some kind of "clone" method much like the c++ copy
constructor to move the data back to the calling method properly?

See http://www.pobox.com/~skeet/csharp/parameters.html for general
information.

If you could give a short but complete example program which
demonstrates your problem, we could see what's going wrong.
 
Back
Top