but we don't know if the size is guaranteed to be a compile-time constant. it could be dependent on user input or some other run-time parameter. perhaps the OP can weigh in on this.
Type: Posts; User: Elkvis
but we don't know if the size is guaranteed to be a compile-time constant. it could be dependent on user input or some other run-time parameter. perhaps the OP can weigh in on this.
I suspect you're referring to the vector's index operator. both the map and its vector elements have an index operator in this case, so it was a little unclear to me at first which one you were...
you have to create enough space for a value at index 7 in your vector. the easiest way to do this is by calling the resize() member function on an entry in your map.