From 67a5236629b6c7748b609f23c0362925b5c4774d Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sun, 24 Nov 2013 23:26:11 -0600 Subject: Add multi-dimensional array description. --- c.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/c.html.markdown b/c.html.markdown index d029a00f..f4edfca5 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -148,6 +148,14 @@ int main() { int cha = 'a'; // fine char chb = 'a'; // fine too (implicit conversion from int to char) + //Multi-dimensional arrays: + int multi_array[2][5] = { + {1, 2, 3, 4, 5}, + {6, 7, 8, 9, 0} + } + //access elements: + int array_int = multi_array[0][2]; //=> 3 + /////////////////////////////////////// // Operators /////////////////////////////////////// -- cgit v1.2.3