在C++可以通过func(CString& str)得到数据,C#该如何写才能得到func(str)函数的str内容
2条回答 默认 最新
threenewbee 2024-11-01 13:39关注C#可以用委托 Action<string> changeStr() { ... return x => { x = "hello world"; }; } 调用 Main() { string s = "aaa"; changeStr()(s); Console.WriteLine(s); //改变为 hello world }解决 无用评论 打赏 举报