From fc47dd9c0f20180ec50f31a9acc5fd0695a62267 Mon Sep 17 00:00:00 2001 From: Carol Nichols Date: Fri, 7 Nov 2014 14:59:42 -0500 Subject: [PATCH] Prepend should be append in the 30 minute intro The examples are about adding to the end of the array, not the beginning. --- src/doc/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/intro.md b/src/doc/intro.md index a197115da90..01697a3e0cb 100644 --- a/src/doc/intro.md +++ b/src/doc/intro.md @@ -217,7 +217,7 @@ including the right thing!) Even though we compiled with flags to give us as many warnings as possible, and to treat those warnings as errors, we got no errors. When we ran the program, it crashed. -Why does this happen? When we prepend to an array, its length changes. Since +Why does this happen? When we append to an array, its length changes. Since its length changes, we may need to allocate more memory. In Ruby, this happens as well, we just don't think about it very often. So why does the C++ version segfault when we allocate more memory?