Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

go语言-切片的增加和删除 #165

Open
platojobs opened this issue Apr 7, 2022 · 0 comments
Open

go语言-切片的增加和删除 #165

platojobs opened this issue Apr 7, 2022 · 0 comments
Labels
MobileDevelopment iOS、安卓、Flutter、go

Comments

@platojobs
Copy link
Owner

platojobs commented Apr 7, 2022

arr := [4]int{1,2,3,4}
    slice := arr[:]
	fmt.Println(slice)
	fmt.Printf("slice = %v\n",slice)

	str := "hello"
	fmt.Println(len(str))

	numbers := []int{}
    for i := 0; i < 10; i++ {
        numbers = append(numbers, i)
		fmt.Println(numbers)
        fmt.Printf("len: %d  cap: %d pointer: %p\n", len(numbers), cap(numbers), numbers)
    }
    fmt.Println(numbers)
@platojobs platojobs changed the title 🐶 165 Jul 22, 2022
@platojobs platojobs changed the title 165 go语言-切片的增加和删除 Sep 3, 2024
@platojobs platojobs added the MobileDevelopment iOS、安卓、Flutter、go label Sep 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
MobileDevelopment iOS、安卓、Flutter、go
Projects
None yet
Development

No branches or pull requests

1 participant