Initial commit
This commit is contained in:
16
14-arrays/04-zero-values/01-uninitialized-array/main.go
Normal file
16
14-arrays/04-zero-values/01-uninitialized-array/main.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var ages [3]int
|
||||
|
||||
fmt.Println(ages)
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
ages := [3]int{1}
|
||||
|
||||
fmt.Println(ages)
|
||||
}
|
18
14-arrays/04-zero-values/03-ellipsis/main.go
Normal file
18
14-arrays/04-zero-values/03-ellipsis/main.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
names := [...]string{
|
||||
"lina", "bob", "jane",
|
||||
}
|
||||
|
||||
fmt.Printf("%#v\n", names)
|
||||
}
|
18
14-arrays/04-zero-values/04-without-ellipsis/main.go
Normal file
18
14-arrays/04-zero-values/04-without-ellipsis/main.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
names := [5]string{
|
||||
"lina", "bob", "jane",
|
||||
}
|
||||
|
||||
fmt.Printf("%#v\n", names)
|
||||
}
|
21
14-arrays/04-zero-values/05-more-examples/main.go
Normal file
21
14-arrays/04-zero-values/05-more-examples/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
names := [5]string{
|
||||
"lina", "bob", "jane",
|
||||
}
|
||||
|
||||
fmt.Printf("%#v\n", names)
|
||||
|
||||
temperatures := [10]float64{1.5, 2.5}
|
||||
fmt.Printf("%#v\n", temperatures)
|
||||
}
|
Reference in New Issue
Block a user