if i have an array with 4 elements set to 0 i could declare it like this
Code:
int my_array[5] = {0};
however suppose i want to declare it with all the elements set to 100 why cant i do this
Code:
int my_array[5] = {100};
if i do the latter i sometimes get a warning that all elements might not be set even if i don't only the first element is set i have to declare and initialize it like this
Code:
int my_array[5] = {100,100,100,100,100};
is this just the way it is and if i have an array with lots of elements i would either have to hard code them all or use a for loop
many thanks
coop