How to zero your memory?






4.25/5 (3 votes)
I always use a home-made macro to zero my struct's and class's:#define ZEROMEMORY ZeroMemory (this, sizeof (*this))Sample1:struct S1 { double x; long i; char s[255+1]; S1 () { ZEROMEMORY; } };Sample2:class foo { private: double x[16]; char a,b,c; foo () {...
I always use a home-made macro to zero my struct's and class's:
#define ZEROMEMORY ZeroMemory (this, sizeof (*this))Sample1:
struct S1 { double x; long i; char s[255+1]; S1 () { ZEROMEMORY; } };Sample2:
class foo { private: double x[16]; char a,b,c; foo () { ZEROMEMORY; } };