Can one (re)set all the values of an array in one line (after it has been initialized)?

前端 未结 4 2196
不思量自难忘°
不思量自难忘° 2021-02-19 13:45

In C, I know I can make an array like this

int myarray[5] = {a,b,c,d,e};

However, imagine the array was already initialised like



        
4条回答
  •  萌比男神i
    2021-02-19 14:23

    No, C doesn't have such feature. If you are setting all array elements to the same value use memset(3).

提交回复
热议问题