Go tests
7.4K subscribers
288 photos
1 video
94 links
По всем вопросам- @haarrp

@itchannels_telegram - 🔥полезные ит-каналы

https://yangx.top/Golang_google - Golang программирование

@golangl - golang chat

@GolangJobsit - golang channel jobs

@golang_jobsgo - go chat jobs
加入频道
Каким будет результат выполнения кода?
Anonymous Quiz
41%
nil
33%
not nil
26%
compilation error
Каким будет результат выполнения кода?
Anonymous Quiz
11%
[0 1 2 3] [0 2 3 3 3]
25%
[0 2 3 3] [0 2 3 3 3]
46%
[0 1 2 3] [0 2 3 2 3]
18%
[0 2 3 3] [0 2 3 2 3]
👣 Что выведет код ?

func foo(a []int) {
a = append(a, 7)
a[1] = 7
}

func bar(a *[]int) {
*a = append(*a, 7)
}

func main() {
a := []int{1, 2, 3, 4, 5, 6}
fmt.Printf("a[1]=%d\n", a[1])

b := a[1:3]
b[0] = 10
fmt.Printf("1. a[1]=%d\n", a[1]) // что выведет?

b = append(b, a...)
b[0] = 100
fmt.Printf("2. a[1]=%d\n", a[1]) // что выведет?

foo(a)
fmt.Printf("3. a[1]=%d\n", a[1]) // что выведет?

bar(&a)
fmt.Printf("4. a=%v\n", a) // что выведет?
}


Ответ

@Golang_google
Please open Telegram to view this post
VIEW IN TELEGRAM
Каким будет результат выполнения кода?
Anonymous Quiz
37%
3 3
11%
3 4
8%
0 0
44%
0 1
👣 Бесплатные курсы по изучению Golang в 2023 году

В этой статье я поделился лучшими бесплатными онлайн-курсами по изучению Golang на таких сайтах, как freeCodecamp, YouTube, Udemy и Coursera .

Читать

@golangtests
Please open Telegram to view this post
VIEW IN TELEGRAM