int *p = NULL;
int n = 0;
scanf("%d", &n);
p = (int*)malloc(sizeof(int) * n);
if(p != NULL){
//初始化内存
memset_s(p, sizeof(int) * n, 0, sizeof(int) * n);
}
free( p); // 使用完释放内存
p = NULL; // 防止野指针
int *p = NULL;
int n = 0;
scanf("%d", &n);
p = (int*)malloc(sizeof(int) * n);
if(p != NULL){
//初始化内存
memset_s(p, sizeof(int) * n, 0, sizeof(int) * n);
}
free( p); // 使用完释放内存
p = NULL; // 防止野指针