69,369
社区成员
发帖
与我相关
我的任务
分享
typedef struct sT{
int a;
unsigned char *p;
}st;
int main()
{
st st_test;
memset(&st_test,0,sizeof(st_test));
printf("p:%p",st_test.p);
*st_test.p=1;
return 0;
}
#include <iostream>
#include <cstring>
using namespace std;
struct T
{
int a;
unsigned char *p;
};
int main()
{
T test;
if(test.p==NULL)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
memset(&test,0,sizeof(test));
if(test.p==NULL)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}