c++ memset 函数 及 坑

#include <string.h>
#include <stdio.h>
 typedef struct ss{
      int num;
      int dir[5][3];
}tent;
tent a;
int main()
{
    memset(&a, 0, sizeof(a));
    return 0;
}

这里有个坑,sizeof(变量名) 而不是 sizeof(tent)
原文地址:https://www.cnblogs.com/i80386/p/4662610.html