invalid types 的问题!!!

main.cpp:54:35: error: invalid types 'long int[int]' for array subscript
                     (*Temporary)[0] = GuessNumber;  //0 用来临时存储 原数字。

这是报错。求助各位大佬这是为什么。

下面是上述变量的声明:

long * Temporary = new long [5]

根据错误提示,(*Temporary) 是一个 long int 类型的指针,不能像数组一样使用下标操作符 []。如果想要使用下标操作符,需要将 Temporary 声明为指向 long int 数组的指针,即:

long int * Temporary = new long int[5];

或者可以直接使用数组名来进行操作,不需要使用指针:

long int Temporary[5];