Is there an easier way in C to set an array to one value than using a for loop and going setting each value one by one?
C
for
Depends on the value. If it's zero, use memset(a, 0, sizeof(a)). Otherwise, if it's a char array you can use memset with some other value. But memset always works at the char level so if your array is not char only zero is likely to be meaningful.
memset(a, 0, sizeof(a))