Method 1: Use the runtime library function memset():
memset(str, 0, sizeof(str));
Method 2: Use the Windows API Function ZeroMemory():
ZeroMemory(str, sizeof(str));
But it cannot be used for pointers.
In the case of pointers, it must be like this:
struct mystr {.....} *p;
...
memset(p, 0, sizeof(struct mystr));
Or:
ZeroMemory(p, sizeof(struct mystr));