An exception that is thrown because the value of a variable is outside the allowed range
Questions tagged [outofrangeexception]
272 questions
-1
votes
1 answer
Multidimensional vector subscript out of range
I'm trying to write a program with a class Cluster, which has a vector of vector of doubles. When trying to find the Centroid (average point) I'm getting an error.
The idea is to get the value of the first coordinate, then second, third, etc. Of…

Msd1994
- 1
- 2
-1
votes
1 answer
std::out_of_range error caused by string.at()
I have got this code:
int n,m; // n - rows count , m - columns in each row count
cin >> n >> m;
string wiersze[n];
int wynik=0;
for(int i = 0; i < n;i++)
{
cin >> wiersze[i];
}
for(int i = 0; i < n;i++)
{
for(int j =0; j

TN888
- 7,659
- 9
- 48
- 84
-1
votes
3 answers
Java - For Loop to insert asterisks between characters of a user inputted string
I'm working on a class assignment with a few individual parts, which I have all done with the exception of this one. I need to get a string input from the user and create a loop (preferably a for loop) that inserts asterisks between each character.…

user2827341
- 3
- 1
- 4
-1
votes
1 answer
Select specific item from list
I am running some functions against a csv file. I call to a specific column and split the text:
with open('lasty.csv','rb') as f:
reader = csv.reader(f, delimiter=',')
for column in reader:
entry = column[7].split(" ")[4]
An…

jkdba
- 2,378
- 3
- 23
- 33
-1
votes
1 answer
Intermittent "out of range" exception on string comparison
Environment: C#, VS2012, SharePoint 2010
I'm using a console application to interface with a SharePoint site and I'm trying to do a simple string comparison against a collection of alert titles... but when debugging I am getting an "out of range"…

thanby
- 323
- 1
- 6
- 22
-1
votes
1 answer
ListBox1.SelectedIndex ArguementOutofRange Error c# Windows Fors
Please some body help me with my codes i am getting ArguementOutofRange Exception again & again. Please tell me what am i doing wrong. I tried every loop for this but it always gives ArgueOutofrange Error.
Exception is:-
"InvelidArguement = value of…

user1563019
- 69
- 1
- 2
- 8
-2
votes
1 answer
How do I solve this in Swift? - 600: Fatal error: Index out of range
I am new to Swift and coding in general.
I am trying to get a list of busy periods from multiple events that occur in one day but keep getting "index out of range."
What is wrong here? (I am sorry my code is very messy)
`func busyPeriod() ->…

Gura
- 5
- 2
-2
votes
2 answers
How to avoid running into IndexError: list index out of range error if an element is nonexistent while parsing xml with BeautifulSoup in python
I have the following code to parse from an xml file to produce a pandas dataframe. The XML file looks like this:
262148
…

tachyon
- 119
- 8
-2
votes
1 answer
Can anyone explain what is the error I am getting in the output and how to remove it?
My code:
#include
#include
using namespace std;
int BinaryToDecimal(int n)
{
int ans = 0;
int x = 1;
while (n > 0)
{
int y = n % 10;
ans = ans + x * y;
x = x * 2;
n = n /…

Abdullah
- 11
-2
votes
1 answer
vb net append list of with list of item/index
I have a custom control object called cc1.
I store cc1 like this Public cc1List As New List(Of cc1) and add stuff to it, works like a charm.
Now i want to remove some item inside it, with a known index, so i create Dim cc1ListTemp As New List(Of…

1lsvks5w2l
- 1
- 1
-2
votes
4 answers
Why do i have an out of range exception working with c++ strings
The code gets an exception of type out of range and i don't know why. It seems to work when i debug it, teh string is converted to what i want it to be.
First time on stack overflow btw:)
#include
using namespace std;
string s;
string…
-2
votes
1 answer
Should "if (argc < 2 || argc > 2)" be fine with 2 arguments? & terminate called after throwing an instance of 'std::out_of_range' error
Solution: Use if (argc !=3) and getline(row_as_stringstream, substr, ';')
This is a continuation of my previous question: error: no matching function for call to, which allowed the code to compile without any errors
I am new to C++ and I am trying…

rlamesch
- 41
- 1
- 8
-2
votes
2 answers
(C# Forms) Hangman game "argumentoutofrange"
The hangman game I'm trying to make throws "ArgumentOutOfRangeException" at the for loop when I'm trying to display the underlines. I tried rewriting the code but nothing worked.
List

lapartman
- 45
- 1
- 7
-2
votes
1 answer
Whenever User Inputs, hits an Out Of Range Error
userInput = input();
for x in range(0,len(userInput)):
if(userInput[x] == " "):
spaceValue = x;
rawWord = userInput[0:spaceValue];
secWord = userInput[spaceValue+1:];
wordArray = [];
repeats = len(rawWord); #NEW VAR
if (len(rawWord) ==…

stathis21098
- 31
- 13
-2
votes
1 answer
Why do I get a msg that an error occurred on a certain character in a file, when the entire file apparently does not contain that many characters?
When I assign an html file to a WebBrowser's Url property, I get this Script err:
So, in an effort to determine what is causing the mayhem, I changed the extension of the file from .html to .txt and tried this code, starting from a spot just before…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862