Lets say I have an array like
int arr[10][10];
Now i want to initialize all elements of this array to 0. How can I do this without loops or
You're in luck: with 0, it's possible.
memset(arr, 0, 10 * 10 * sizeof(int));
You cannot do this with another value than 0, because memset works on bytes, not on ints. But an int that's all 0 bytes will always have the value 0.
memset
int
0