typedef struct tagTestStructor{virtual void testOut(){ std::cout << "this is a virtual function" << std::endl;}int m_nVal;char m_cVal;// ...}TestStructor;int _tmain(int argc, _TCHAR* argv[]){TestStructor objTest;memset(&objTest, 0, sizeof(objTest) );// use a pointer to testTestStructor* pObjTest = &objTest;pObjTest->testOut();} 这篇关于用meset初始化数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-10 20:54