-
Array in GO are fixed sized and are of same type
-
They are copy by value by default
-
We can use built in functions like len(), cap() to identify length and capacity of array
-
Multiple ways to use array
- var arr = [size]dataType{...values}
- arr := [size]dataType{...values}
- var arr = [...]dataType{...values}
- var arr = [3]dataType and then arr[0], arr[1], arr[2]
- Copy array into other array (call by value)
- Pass reference of arr to other array (call by reference)
Files
array
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||