您好我希望能够随机选择一组给定的颜色并将其存储到数组结构中。
void addrand(struct inv[],int *ptr)
const char *random[6];
random[0] = "red";
random[1] = "green";
random[2] = "yellow";
random[3] = "blue";
random[4] = "white";
random[5] = "black";
inv[*ptr].color = random[rand()%6];
我得到的类似数组类型' char [30]'不可分配。