How to pass references as arguments in a method in c#

前端 未结 7 1063
花落未央
花落未央 2021-01-25 00:54

How can you pass refernces in C#?

相关标签:
7条回答
  • 2021-01-25 01:29

    You can pass parameters by reference in C# using this syntax.

    public void MyMethod(ref string myString)
    {
    
    }
    

    You will then need to put ref before the value when passing it.

    0 讨论(0)
提交回复
热议问题