冰封酱 2016-11-26 06:40 采纳率: 0%
浏览 3039

CXX0030: 错误: 无法计算表达式的值

#include
#include
#include

int sort(char **myp1,int num1,char (*myp2)[30],int num2,char ***myp3,int *num3)
{
char **p3 =NULL;

p3 = (char **)malloc(6*sizeof(char*) );
int i=0,j=0,k=0;
int tmplen =0;

for (i;i<num1;i++)
{
tmplen =strlen(myp1[i])+1;
p3[i] = (char*)malloc(tmplen*sizeof(char));
if (p3[i]=NULL)
{
return -2;
}
strcpy(p3[i],myp1[i]);
}

for (j;j<num2;j++,i++)
{
tmplen=strlen(myp2[j])+1;
p3[i]=(char*)malloc(tmplen*sizeof(char));
strcpy(p3[i],myp2[j]);
}
char *tmp;
int count = num1+num2;
for (i=0;i<count;i++)

{
for(j=i+1;j {
if (strcmp(p3[i],p3[j])>0)
{
tmp=p3[i];
p3[i]=p3[j];
p3[j]=tmp;
}
}
}
*num3 = count;
*myp3 = p3;
return 0;
}

int main()
{
int ret =0;
int num1,num2,num3=0,i=0;

char *p1[]={"aaaa","bbbb","cccc"};
char p2[10][30]={"1111","3333","4444"};

num1 = sizeof(p1)/sizeof(*p1);
num2 =3;

char **p3 =NULL;
ret =sort(p1,num1,p2,num2,&p3,&num3);
if (ret != 0)
{
printf("error:%d",ret);
return ret;
}

for (i;i<num3;i++)
{
printf("%s\n",p3[i]);
}
system("pause");
return 0;
};

新萌求各位大佬帮帮忙。

  • 写回答

1条回答 默认 最新

  • dabocaiqq 2016-11-26 15:19
    关注
    评论

报告相同问题?

悬赏问题

  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗