summaryrefslogtreecommitdiffhomepage
path: root/c.html.markdown
diff options
context:
space:
mode:
authorBrendan Batliner <brendan.batliner@gmail.com>2015-10-15 16:38:42 -0500
committerBrendan Batliner <brendan.batliner@gmail.com>2015-10-15 16:38:42 -0500
commit36fe7e1ccec6be05a98b9a8bee633073dca0d24d (patch)
treeb62d21b1ed49332d10459ef9768eeffec10af3c4 /c.html.markdown
parent2acf7822bdf45909d6c92fe30515b2a3b40e6c22 (diff)
Added example of printIntArray in C
Diffstat (limited to 'c.html.markdown')
-rw-r--r--c.html.markdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/c.html.markdown b/c.html.markdown
index b4129f7a..3d632eab 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -557,6 +557,12 @@ void printIntArray(int *arr, int size) {
printf("arr[%d] is: %d\n", i, arr[i]);
}
}
+/*
+int my_arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+int size = 10;
+printIntArray(my_arr, size);
+// will print "arr[0] is: 1" etc
+*/
// if referring to external variables outside function, must use extern keyword.
int i = 0;