Go Arrays: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:


=Array Literals=
=Array Literals=
=Array Operators and Functions=
==Indexing Operator==
Indexing operator <tt>[[Go Concepts - Operators#.5B.5D|[]]]</tt> returns the value at that position.
==Array Length==
<tt>[[Go Built-In Functions Length and Capacity#len.28.29|len()]]</tt>

Revision as of 22:35, 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

Array Operators and Functions

Indexing Operator

Indexing operator [] returns the value at that position.

Array Length

len()