Is this the correct way to use memset() in C?
#include int arr[10]; memset(arr, 0, sizeof(arr)); // Sets all bytes of `arr` to 0 Use sizeof to avoid size errors.Use it for simple types (e.g., arrays, structs without pointers).Snow Rider
Answered Feb 12, 2025 · 1.1K Views Read answer →