An exception that is thrown because the value of a variable is outside the allowed range
Questions tagged [outofrangeexception]
272 questions
-2
votes
1 answer
C++ - 'std::out_of_range'
Although I've wrapped the try code around every part of my program I can't get the line that causes the runtime error (without any other details):
"terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check…

gauche_z
- 1
- 3
-2
votes
1 answer
c# string split ignores empty values between delimiters
Hey i already asked this but its not solved still, nothing worked , here my complete code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Insertss
{
class Program
{
static…

user3107760
- 27
- 4
-2
votes
2 answers
Vector subscript out of range. Line 1140. C++
I'm reading in a file that is a question pool that has the type of question, chapter, how many points it is worth, the question and the answer. This bit of code is checking to see if the min and max chapters(from user input) are in range(from a file…

johnreeves
- 55
- 1
- 1
- 8
-2
votes
1 answer
How to handle: Argument out of range?
When I load a picture in the picturebox and don't click on the picturebox first it break.
When I put the return back in the code it goes to an endless loop and when I remove it the code breaks.
Here is the code. It always breaks at point1 and I…

Fady Mounir
- 7
- 2
-2
votes
2 answers
Unhandled exception at 0x77e4bef7 in 1.exe: Microsoft C++ exception: std:out_of_range at memory location 0x0012fb8c
There's something wrong in rows 25-30. I requested the existing index but get an error. I don't understand the problem, what's wrong?
string *shells_host = new string[cnt];
for(int i=0;i

bagi
- 21
- 2
- 8
-3
votes
1 answer
Out of range index when using print function but not return
I'm new to python and found this small exercise online:
"Create a Python program to print the character that repeats itself in a subsequent sequence"
The solution that was given was the following:
def same_subsequent(string):
for i in…

Jérèmy
- 1
-3
votes
2 answers
Program not catching IndexOutOfRangeException
I'm following an old YouTube guide for C# learning and I'm stuck on one of the challenges for error handling.
class Program
{
static Board myBoard = new Board(8);
public static Cell setCurrentCell()
{
int currentRow,…

TwiiXzzeL
- 1
- 1
-3
votes
2 answers
How to debug a System.ArgumentOutOfRangeException error in C#?
This code is supposed to take two samples one original and one new, then determine the length of the smallest single consecutive piece that has been inserted into the first sequence.
When trying some samples I get the following error…

SeanleArch
- 19
- 2
-3
votes
1 answer
Vector of structs generating out-of-range error when member is accessed C++
I'm writing a library application. Part of the application is allowing users to login. I'm using a vector of structs to store the usernames/passwords. When I try to access a member variable of the struct, I get an out of range error. The vector is…

Seth Taylor
- 9
- 4
-3
votes
1 answer
List out of range error in python code
I am writing a simple python program which allows us to list all video files in a directory and play them according to the user input. However, I am getting an list out of range error while running this code.
Code:
import os
from subprocess import…

Varun Chopra
- 43
- 6
-4
votes
1 answer
INT_MAX divided by twice of itself (INT_MAX * 2)
in C++, I wonder how to get the correct answer 0.5 for "INT_MAX / (INT_MAX + INT_MAX)"? I tried cast the divisor/both divisor and dividend to long, and also cast divisor to double, all return -1073741823. Could anyone give me some advice ? Thanks.

Eric Wong
- 3
- 6
-4
votes
1 answer
Why am I getting StringIndexOutOfBoundsException: String index out of range: 65
I am using a shellsort to find the populations from an input file.
Here is my Code:
package assignment.pkg3;
import java.io.*;
import java.util.*;
public class Sorting{
public static void main (String[] args) throws IOException
{
…

Dylan
- 1
- 1
- 1
-4
votes
1 answer
Python -- How is my list out of range?
The assignment was to let the user choose to either read the data file or to write to the data file. I figured out how to write to it but I cannot understand my current error: that my list is out of range.
Can someone tell me how my list is out of…
-5
votes
2 answers
C++ Vector Subscript out of range with opencv error
Any thoughts where I might be going wrong. PS: New to coding and StackOverFlow.
#include
#include
#include
#include
#include
//Declare the image…

Mind Chants
- 11
- 1
-6
votes
3 answers
C# Arraylist out of range
Consider the my following code:
for (int a = 0; a < isim.Count; a++)
{
Console.WriteLine(nu[a] + "\t" + isim[a] + "\t" +mail[a]);
}
Here are my execution results :