In Go, a slice value is a small header containing a pointer, a length, and a capacity. What does the capacity represent?
- aThe number of elements currently stored in the slice, same as its length
- bHow many elements fit in the underlying array from the slice's start onward✓
- cThe total memory in bytes allocated for the slice header itself
- dThe maximum number of elements Go allows any slice to ever hold
Explanation:Length is how many elements the slice currently exposes. Capacity is how far the underlying array extends past the slice's start, so append can grow into that space without allocating a new array until capacity runs out.