Answer the question
In order to leave comments, you need to log in
What are arrays for in golang?
Judging by chapter golang-book.ru/chapter-06-arrays-slices-maps.html and practice
An array in golang has only a fixed length:
I.e. you cannot create an array of indefinite length like var x []int for this there is a slice:
In the textbook they write:var x [5]int
var x []int
A slice is part of an array.
Answer the question
In order to leave comments, you need to log in
If there is a slice in the program, then there is an array corresponding to it in memory. You don't create it yourself, but Goshka's runtime creates it.
The array is needed as a lower-level primitive, to speed up work in some cases, so as not to produce unnecessary pointers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question