错误:索引超出范围.必须为非负且小于集合的大小 [英] error:index was out of range .must be non negative and less than the size of the collection

查看:197
本文介绍了错误:索引超出范围.必须为非负且小于集合的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:索引超出范围.必须为非负且小于集合的大小.

error:index was out of range .must be non negative and less than the size of the collection

推荐答案

您最好让我们知道,您实际上是什么人在执行或共享导致此错误的代码.
you better let us know, what are you actually doing or share some code which is causing this error.


这仅表示您正在尝试访问不存在的索引.

例如:
您定义了一个由10个元素组成的数组A.当您尝试访问A [15]时,将出现索引超出范围错误.由于您定义了10个元素,因此有效值只能是0到9.
It simply means that you are trying to access an index that does not exists.

For example:
You define an array A of 10 elements. When you try to access A[15] you will get an index out of range error. Since you defined 10 elements, valid values are from 0 to 9 only.


这篇关于错误:索引超出范围.必须为非负且小于集合的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆