我试图在这个数组的末尾插入一个空终止符。我将如何解决它?
int cool_array[10] = {0};
int i = 0;
while (i < 5) {
cool_array[i] = 5;
i++;
}
cool_array[i] = {'\0'} // this is where the problem is. I get an error.
错误:
error: expected expression
legal_cards[legal_counter] = {'\0'};
^
1 error generated.