相关疑难解决方法(0)

数组下标的无效类型'int [int]'

这段代码会引发标题中给出的编译错误,有人能告诉我要改变什么吗?

#include <iostream>

using namespace std;

int main(){

    int myArray[10][10][10];

    for (int i = 0; i <= 9; ++i){
        for (int t = 0; t <=9; ++t){            
            for (int x = 0; x <= 9; ++x){
                for (int y = 0; y <= 9; ++y){

                myArray[i][t][x][y] = i+t+x+y; //This will give each element a value

                      }
                      }
                      }
                      }

    for (int i = 0; i <= 9; ++i){
        for (int t = 0; t <=9; ++t){
            for (int x = …
Run Code Online (Sandbox Code Playgroud)

c++ arrays compiler-errors

7
推荐指数
3
解决办法
9万
查看次数

标签 统计

arrays ×1

c++ ×1

compiler-errors ×1