C# vs VB parameter passing

bri189a

Well-known member
Joined
Sep 11, 2003
Messages
1,004
Location
VA
Is there a differance between VB and C# parameter passing that I need to be aware of (as far as default type (ByVal, or referance), as far as doing specifics: ref/out/normal compared to VBs equivelants?
 
Not really, passing by value is the default for both. C# is a little more strict when it comes to reference parameters, though - it separates them in to "ref" and "out" parameters. Ref is standard passing a variable by reference, but out forces the procedure to explicitly assign to the parameter before leaving.

Also, C# makes you specify "ref" and "out" when actually calling the method, too.
 
Back
Top