gpt4 book ai didi

vb.net - 在 vb.net 中,感叹号(!)运算符用于数字,它有什么作用?

转载 作者:行者123 更新时间:2023-12-03 00:53:48 24 4
gpt4 key购买 nike

我正在查看继承的代码,并在 vb.net windows 窗体中找到了它:

New System.Drawing.SizeF(6.0!, 13.0!)

我的问题是,这里的!(感叹号)运算符有何意义?我对感叹号运算符的大部分搜索最终都会返回记录集格式,或者 ! 在搜索中被忽略,并且我得到了数百个不相关的项目。

最佳答案

它强制文字为 Single。

Visual Basic 支持Type Characters :

In addition to specifying a data type in a declaration statement, you can force the data type of some programming elements with a type character. The type character must immediately follow the element, with no intervening characters of any kind.

和:

Literals can also use the identifier type characters (%, &, @, !, #, $), as can variables, constants, and expressions. However, the literal type characters (S, I, L, D, F, R, C) can be used only with literals.

关于vb.net - 在 vb.net 中,感叹号(!)运算符用于数字,它有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6732943/

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