執行 ❯
建立您
自己的
網站
×
更改方向
更改主題,深色/淺色
前往 Spaces
#include <iostream> #include <deque> using namespace std; int main() { // Create a deque called cars that will store strings deque<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; // Try to access an element that does not exist (will throw an exception) cout << cars.at(6); return 0; }
terminate 呼叫在丟擲一個 'std::out_of_range' 例項後被呼叫 what(): vector::_M_range_check: __n (值為 6) >= this->size() (值為 4)