GOLANGTESTS Telegram 345
👣 Что выведет код ?

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
2



tgoop.com/golangtests/345
Create:
Last Update:

👣 Что выведет код ?

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

BY Go tests


Share with your friend now:
tgoop.com/golangtests/345

View MORE
Open in Telegram


Telegram News

Date: |

Ng was convicted in April for conspiracy to incite a riot, public nuisance, arson, criminal damage, manufacturing of explosives, administering poison and wounding with intent to do grievous bodily harm between October 2019 and June 2020. Members can post their voice notes of themselves screaming. Interestingly, the group doesn’t allow to post anything else which might lead to an instant ban. As of now, there are more than 330 members in the group. Users are more open to new information on workdays rather than weekends. The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.” To edit your name or bio, click the Menu icon and select “Manage Channel.”
from us


Telegram Go tests
FROM American