【发布时间】:2023-03-31 12:23:02
【问题描述】:
我需要将数组的所有值初始化为 0。newCount->numbers[1] = {0} 给出错误“预期表达式”。我该怎么办?
typedef struct count *Count;
struct count{
int numbers[101];
int totalCalls;
int totalCallsEach[101];
};
Count create_Count(void){
Count newCount = malloc(sizeof(struct count));
newCount->numbers[101] = {0};
newCount->totalCalls = 0;
return newCount;
}
【问题讨论】: