I have found out that vectors are heap allocated whereas arrays are stack allocated, but this was not mentioned anywhere in the book.