Last active
April 3, 2017 22:32
-
-
Save johnhmj/caaab9b4b8814ff0e5fb6250cbeb2382 to your computer and use it in GitHub Desktop.
Win32 C/C++ InitStruct macro, initialize your structure as ZeroMemory, http://johnmhsheep.pixnet.net/blog, https://johnmhsieh.blogspot.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _INITSTRUCT_H_ | |
#define _INITSTRUCT_H_ | |
// | |
// initialize struct | |
#define InitStruct(s, t) memset((void*) s, 0x0, sizeof(t)) | |
// | |
// copy struct | |
#define CopyStruct(s_dst, s_src, t) memcpy((void*) s_dst, (void*) s_src, sizeof(t)) | |
// | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment