c语言中怎么把一个数组的值赋到另一个数组中
doubleb1[5][2]={3,4,1,2,2,1,5,3,4,5};doublerel[5][2]={0};doublerel_1[5]={0.0667,0.190...
double b1[5][2]={3,4,1,2,2,1,5,3,4,5}; double rel[5][2]={0}; double rel_1[5]={0.0667,0.1905,0.3143,0.4381,0.5619}; int l=0; double *p_rel_1=rel_1; for (i=0;i<5;i++) { for (j=0;i<2;j++) { l=(int)(n-b1[i][j]); rel[i][j]=*(p_rel_1+l); rel[i][j]=1; l=0; } } delete p_rel_1; for (i=0;i<5;i++) { for (j=0;i<2;j++) { printf("rel[%d][%d]=%5.4lf ",i,j,rel[i][j]); } printf("\n"); } 为什么程序说内存无法写入呢?求大侠指点,怎么把数组的值赋值到rel数组中呢?
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询