关于 error: invalid types ‘int[int]‘ for array subscript 的解决

简介: 关于 error: invalid types ‘int[int]‘ for array subscript 的解决

假如这个报错语句定位到的地方是数组,出现这个报错的原因大致如下:

情况一、当前数组和某变量名字重复了。

这种情况下,oj报的是CE

微信图片_20221018221153.png

微信图片_20221018221242.png

假如是变量名不一致,或者没有定义,报的是这个:微信图片_20221018221335.png

然后C++和C是没有数组角标越界的提示的…

微信图片_20221018221404.png

相关文章
|
9月前
error C2040: ‘n‘ : ‘int [1000]‘ differs in levels of indirection from ‘int ‘
error C2040: ‘n‘ : ‘int [1000]‘ differs in levels of indirection from ‘int ‘
82 0
|
4月前
|
Python
TypeError: int() argument must be a string, a bytes原因
Python开发过程中,使用int()函数来转换或生成int类型的数据时,如果Python抛出并提示TypeError: int() argument must be a string, a bytes-like object or a real number, not 'complex',那么原因在于传递给int()函数的参数类型有误,正如TypeError的提示,int()函数的参数必须是string字符串(数值字符串)、类似字节对象、real number数字等,而不可以是complex复数类型的数据。
108 0
HalconDotNet.HTupleAccessException:“‘Cannot convert to double array‘ when accessing ‘HalconDotNet.HT
HalconDotNet.HTupleAccessException:“‘Cannot convert to double array‘ when accessing ‘HalconDotNet.HT
|
8月前
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
504 0
|
10月前
|
关系型数据库 MySQL C++
类型收窄 error C2397: conversion from ‘const int‘ to ‘char‘ requires a narrowing conversion
类型收窄 error C2397: conversion from ‘const int‘ to ‘char‘ requires a narrowing conversion
114 0
TypeError: randint() received an invalid combination of arguments - got (int, int, int), but expecte
TypeError: randint() received an invalid combination of arguments - got (int, int, int), but expecte
527 0
TypeError: sequence item 0: expected string, int found
TypeError: sequence item 0: expected string, int found
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘