FileStream.Read method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Do you know how the method FileStream.Read populate the Char array if
we don't use out or ref?

Thank you,
Roby Eisenbraun Martins
 
Roby Eisenbraun Martins
Do you know how the method FileStream.Read populate the Char array if
we don't use out or ref?

(I assume you either mean a byte array, or you're using managed C++ -
streams don't deal with characters, they deal with bytes.)

Because arrays are reference types. When you pass an array, you're
actually passing a reference to the array. The method call can change
the contents of the array without changing the value of your variable.

See http://www.pobox.com/~skeet/csharp/parameters.html for more
information.
 
Back
Top