###Out of bounds###
Out of bounds
for(int j = 0; j < numbers.size(); j++) {
if(numbers[j] > numbers[j + 1]) {
When j
reaches numbers.size() - 1
, you will read past the end of your vector.
###Out of bounds###
for(int j = 0; j < numbers.size(); j++) {
if(numbers[j] > numbers[j + 1]) {
When j
reaches numbers.size() - 1
, you will read past the end of your vector.
Out of bounds
for(int j = 0; j < numbers.size(); j++) {
if(numbers[j] > numbers[j + 1]) {
When j
reaches numbers.size() - 1
, you will read past the end of your vector.
lang-cpp