Casting C# out parameters?

后端 未结 6 1613
孤城傲影
孤城傲影 2020-12-30 20:35

Is it possible to cast out param arguments in C#? I have:

Dictionary dict;  // but I know all values are strings
string key, value;
         


        
6条回答
  •  我在风中等你
    2020-12-30 20:50

    No, you can't. The code inside the method is directly modifying the variable passed to it, it is not passed a copy of the content of the variable.

提交回复
热议问题