- 论坛徽章:
- 0
|
5可用积分
#include <stdio.h>
#define L_BBXRBH32 2
#define NO 11
struct BH
{
char bbxrbh[L_BBXRBH32+1];
int iflag;
};
int iLen=0;
int i=0,j=0;
int iNo=0;
int iRec=0;
char strBh[NO][L_BBXRBH32+1];
struct BH *lpBh=NULL;
struct BH *lpBh1=NULL;
iRec=NO;
iLen=sizeof(struct BH);
lpBh1=(struct BH *)malloc(iLen*iRec);
printf("aa\n");
if(lpBh1!=NULL)
{
printf("fuck\n");
memset(lpBh1,0x00,iLen*iRec);
printf("fuck1\n");
/* 运行到这里就core掉,搞不懂了,请高手指点指点 编译环境是aix 但是在windows下 vc里面运行是没有问题的 不知道为什么了 郁闷*/
strcpy(lpBh1[0].bbxrbh,"GG");
printf("fuck2\n");
strcpy(lpBh1[1].bbxrbh,"BB");
strcpy(lpBh1[2].bbxrbh,"AA");
strcpy(lpBh1[3].bbxrbh,"AA");
strcpy(lpBh1[4].bbxrbh,"AA");
strcpy(lpBh1[5].bbxrbh,"DD");
strcpy(lpBh1[6].bbxrbh,"AA");
strcpy(lpBh1[7].bbxrbh,"AA");
strcpy(lpBh1[8].bbxrbh,"CC");
strcpy(lpBh1[9].bbxrbh,"AA");
strcpy(lpBh1[10].bbxrbh,"AA");
}
|
最佳答案
查看完整内容
代码本身没有问题。可能是没有包含必要的头文件。你加上:#include #include 试试
|