-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringRet.swift
More file actions
39 lines (39 loc) · 1.05 KB
/
stringRet.swift
File metadata and controls
39 lines (39 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
let stgl="wow"
let globArrStr=[[["glob [0][0][0]","glob [0][0][1]"],["glob [0][1][0]","glob [0][1][1]"]],[["glob [1][0][0]","glob [1][0][1]"],["glob [1][1][0]","glob [1][1][1]"]]]
func strtest(_ a: Int) -> String {
if a==0{
let st=stgl+" it works"
return st
}
}
func printStr() {
for i in 0..<2{
for j in 0..<2{
for z in 0..<2{
print(globArrStr[i][j][z])
}
println()
}
println()
}
}
func printStrLocal(_ arrStr:[[[String]]]) {
for i in 0..<2{
for j in 0..<2{
for z in 0..<2{
print(arrStr[i][j][z])
}
println()
}
println()
}
}
func main(){
println("Here is the string generated by the function strtest:")
println(strtest(0))
println("\nHere is the global array of strings printed:")
printStr()
let locArrStr=[[["first","second"],["third","fourth"]],[["fifth","sixt"],["seventh","eight"]]]
println("Here is instead the local one:")
printStrLocal(locArrStr)
}