array size missing in
时间: 2024-01-06 16:06:36 浏览: 179
这个错误通常是因为您在定义数组时没有指定数组的大小。
例如,在C语言中,如果您想定义一个大小为10的整数数组,您可以这样写:
```
int myArray[10];
```
如果您忘记了指定数组的大小,编译器就会报出 "array size missing" 错误。
请检查您的代码,确保在定义数组时指定了正确的大小。
相关问题
17 10 D:\Jacky\武大\程序设计\大整数\项目\main.c [Error] array size missing in 'data1'
这个错误是因为在声明数组时没有指定数组的大小。在C语言中,声明数组时需要指定数组的大小,以便编译器知道为数组分配多少内存空间。
例如,如果你想声明一个包含10个整数的数组,你可以这样写:
int data1[10];
如果你不确定数组的大小,你可以使用动态内存分配来创建一个动态大小的数组。这可以通过使用malloc函数来实现。例如:
int *data2;
int size = 10;
data2 = (int*)malloc(size * sizeof(int));
在这个例子中,我们使用malloc函数分配了一个包含10个整数的数组,并将其赋值给指针data2。请注意,使用动态内存分配后,你需要在不再使用数组时使用free函数释放内存。
希望这个解释对你有帮助。如果你有任何其他问题,请随时提问。
ValueError: cannot reshape array of size 0 into shape (80,60)
This error occurs when you try to reshape an array into a shape that is incompatible with its current size. In this case, you are trying to reshape an array of size 0 into a shape of (80,60), which is not possible.
There are a few possible reasons why this error might occur:
1. Incorrect input: It's possible that the input data you are trying to reshape is empty or missing some values.
2. Incorrect dimensions: It's possible that the dimensions of your array are not what you expect them to be. For example, if you have a 1D array with 4800 elements, you could reshape it into a 2D array with shape (80, 60), but if you have a 1D array with only 10 elements, you cannot reshape it into a 2D array with shape (80, 60).
3. Incorrect reshape operation: It's possible that you are using the reshape() function incorrectly. Make sure that you are passing in the correct arguments and that the dimensions you are trying to reshape to are compatible with the size of the array.
To fix the error, you should check your input data and make sure it is not empty or missing any values. You should also double-check the dimensions of your array and make sure they are what you expect them to be. Finally, make sure that you are using the reshape() function correctly and passing in the correct arguments.