Say I have an array
unsigned char digit[] = {0, 1, 2, 3, 4, 5, 6, 7};
However, I want to change part of the array, to make the array look like:
{0, 1, 2, 3, 0, 0, 0, 0}
Listing each item that I want to modify and change may take some effort. Especially when there are a large number of elements that I want to change. I know that in some languages, such as Pyhton, I can do something with a single line of code:
a = np.array([0, 1, 2, 3, 4, 5, 6, 7])
a[4:] = [0, 0, 0, 0]
//a: array([0, 1, 2, 3, 0, 0, 0, 0])
So, interestingly, is there a similar way to do this in C?