array[10]={9,8,7,6,5,4,3,2,1,0};
Which you have already declared some where in your code as
int array[10];
You can only specify the initialization list during declaration of the array hence the error, if you want to assign the values somewhere else in your code except declaration then use the for loop or direct assignment at particular index such as
for(int i =0; i< 10; ++i)
array[i] = value;
or
array[0] = value0;
.
.
.
array[9] = value9;
Hope this helps...
No comments:
Post a Comment