gpt4 book ai didi

variables - 在 swift 中使用哪个声明

转载 作者:搜寻专家 更新时间:2023-10-30 22:13:10 25 4
gpt4 key购买 nike

<分区>

我真的不知道如何在 Swift 中声明我的变量,我有四个选择:

var value = 0.0 // I know this one declares value as a Double with the number 0.0
var value: Float = 0.0 // This one declares value as a Float with the number 0.0
var value: Float? // I really don't get the difference between this
var value: Float! // and this, I just know that both of them are used to declare a variable without a value, am I right ?

我只想声明一个 float 而不赋予一个值,最好的方法是什么?

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