add: unfinished code. people are having problems
This commit is contained in:
25
14-arrays/01-whats-an-array/main.go
Normal file
25
14-arrays/01-whats-an-array/main.go
Normal file
@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var (
|
||||
myAge byte
|
||||
herAge byte
|
||||
|
||||
// uncomment the code below and observe the error
|
||||
// wrongDeclaration [-1]byte
|
||||
|
||||
zero [0]byte
|
||||
ages [2]byte
|
||||
agesExp [2 + 1]byte
|
||||
|
||||
tags [5]string
|
||||
)
|
||||
|
||||
fmt.Printf("%d %d\n", myAge, herAge)
|
||||
fmt.Printf("%#v\n", zero)
|
||||
fmt.Printf("%#v\n", ages)
|
||||
fmt.Printf("%#v\n", agesExp)
|
||||
fmt.Printf("%#v\n", tags)
|
||||
}
|
Reference in New Issue
Block a user