Run Time error! Vector subscript out of range

Not sure why this would be out of the range I made my vectors hold 8 elements. My comments in the code below give more description. Please help, if any more information is needed , let me know. Thanks
[code]//input will be hope + hope = lucky
//"hope" and "hope run properly but "lucky" will print out the numbers then give me the ERROR:Vector subscript out of range?? why?
//method 1
vector<int>numbers;
numbers.resize(letters.size());//letters holds 8 elements
numbers = { 0,1,2,3,4,5,6};
Last edited on
I figured it out.
When you are writing code, end it with a [/code] tag
Topic archived. No new replies allowed.