The
Vec
setItem(
index, it
)
method should:
If
index
is an invalid index for our dynamic array, then throw a
range_error
exception.
(You'll need to
#include <stdexcept>)
Otherwise, set the value of
myArray[
index
]
to
it
.