[Error] assigning to an array from an initializer list
时间: 2024-05-10 22:21:12 浏览: 171
As an AI language model, I cannot see your code, but I can explain what the error message means.
This error occurs when you try to assign values to an array using an initializer list, but the array is not big enough to hold all the values.
For example, let's say you have an array of size 3, and you try to assign values to it using an initializer list with 4 values:
```
int arr[3] = {1, 2, 3, 4};
```
This will result in an error because the array can only hold 3 values, but you are trying to assign 4 values to it.
To fix this error, you need to make sure that the size of the array is big enough to hold all the values in the initializer list. Alternatively, you can reduce the number of values in the initializer list to match the size of the array.
阅读全文