modify 07.1.md

This commit is contained in:
chidouhu
2013-11-20 14:50:00 +08:00
parent 8545fa5ca3
commit 9dbd1c5d2a
10 changed files with 162 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package main
import "fmt"
func main() {
sl_from := []int{1, 2, 3}
sl_to := make([]int, 10)
n := copy(sl_to, sl_from)
fmt.Println(sl_to)
fmt.Printf("Copied %d elements\n", n) // n == 3
sl3 := []int{1, 2, 3}
sl3 = append(sl3, 4, 5, 6)
fmt.Println(sl3)
}