Hi everyone, I have been stuck with this problem for the past two hours. The program asks the user for the names and values of their cars, stores them in tokens, and then puts the tokens into a vector. Then it prints out what the user entered. This program compiles and works up until the last part, at line 36. I don't know if anything is wrong with the for loop. Everything prints out fine, but I get a "Debug Assertation Failed!" error at line 1234. Expression: vector subscript out of range. Is there something I'm missing here? I don't know what's wrong. Thanks for your help and time.
The problem had nothing to do with the type. The problem was that valid indices in a vector fall into the range 0 to vectorSize - 1. By changing i <= cars.size() to i < cars.size() you stop yourself from trying to use cars.size() as an index (which is beyond the valid range of indices).