This answer quotes ChatGPT
In C++, the single quotation mark "" is often used to indicate character constants, such as 'a' for the character a. Therefore, it is illegal to use single quotes to assign an array because an array should contain multiple elements rather than a single character.
Normally, to initialize an array, use braces {} to contain a list of elements, such as
int arr[] = {1, 2, 3, 4, 5};
This creates an integer array arr with five elements, where each element is 1, 2, 3, 4, and 5.
Of course, you can also use loop statements to assign values to arrays, such as .int arr[5];
for (int i = 0; i < 5; i++) {
arr[i] = i + 1;
}
This also creates an integer array arr with five elements, where each element is 1, 2, 3, 4, and 5.