I have such array with size of 24 byte
:
char* arr[3] = {"CERN", "0", "ALK"};
printf("%ld\n", sizeof(arr));
Then I try to clear this array from memory by assigning \0
to each element of array:
for (size_t i = 0; i < sizeof(arr)/ sizeof(char*); ++i) {
arr[i] = '\0';
}
But when I want to check the size of array, it still gives me 24 byte
:
printf("%ld\n", sizeof(arr));
> 24
How to completely clear this array from memory that sizeof(arr)
would give 0
?