Go Arrays: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
var a [5]int
var a [5]int
</pre>
</pre>
A declaration without explicit initialization initializes the array with the [[Go Concepts - The Type System#Zero_Value|type's zero value]].


=Array Literals=
=Array Literals=

Revision as of 06:10, 27 March 2016

Internal

Overview

An array is a numbered sequence of elements, of a single type, and with a fixed length.

Declaration

var a [5]int

A declaration without explicit initialization initializes the array with the type's zero value.

Array Literals