DEV Community

Discussion on: Things you need to know as a C# developer - Build types

Collapse
 
ivanmaia profile image
Ivan Maia

Hi.

Thanks for sharing your knowledge.

Let me suggest an improvement.

Sample code provided for "Passing Value Types by Reference" is the same you wrote for "Passing Value Types by Value".

Best regards.

Collapse
 
samfieldscc profile image
Sam Fields

Hi Ivan,

Thanks for the response!

If you look more carefully at lines 3 and 15 you will see that in fact the parameters are being passed by reference with the use of the "ref" keyword. Which leads to different results. I invite you to try it on your machine or using dotnetfiddle.net/ to check this.

Best regards.