Answers for "type variable in swift"

1

swift variable

// var variableName = stringOrInt

var number1 = 200
var brother = "John"
var player1Score = 597
Posted by: Guest on June-14-2021
0

how to name a variable of a specific type in swift

var myString: String = "this is a string"
var myInt: Int = 123
var myDouble: Double = 3.1415 // 64-bit 
var myFloat: Float = 3.14 // 32-bit
var myArray: [Int] = [3, 54, 12, 0] // can change to any other [type]
Posted by: Guest on September-28-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language