gpt4 book ai didi

c# - .NET 框架库中的 ref 关键字示例

转载 作者:行者123 更新时间:2023-11-30 13:15:08 27 4
gpt4 key购买 nike

DateTime.TryParse 方法有一个 DateTime out 参数。

public static bool TryParse(string s, out DateTime result)

ref关键字在.NET框架中有这样的用法吗?

最佳答案

是的,例如 Interlocked.Exchange 的各种重载:

public static double Exchange(
ref double location1,
double value
)

关于c# - .NET 框架库中的 ref 关键字示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14527488/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com