#include <stdio.h>
#include <string.h>
int main() {
int arr[5] = {1, 2, 3, 4, 5};
// void *memset(void *str, int c, size_t n)
// str − A pointer to the block of memory to fill
// c − The value to be set
// n − The number of bytes to be set
memset(arr, 0, 8); // set 0 to first two int values (int - 4 bytes)
for (int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
return 0;
}
/*
run:
0 0 3 4 5
*/