新人求助!!
陌生归路 2018-10-04 10:02:18 #include <stdio.h>
void cpy(int m,int n,double a[m][n],double b[m][n]);
void putout(int m,int n,double h[m][n]);
int main (void)
{
double num1[3][5]={{3,4,5,6,7},
{8,9,2,3,4},
{7,3,2,4,5}};
double num2[3][5];
putout(3,5,num1);
cpy(3,5,num1,num2);
putout(3,5,num2);
return 0;
}
void putout(int m,int n,double h[m][n])
{
int a,b;
for(a=0;a<m;a++)
{
for(b=0;b<n;b++)
printf("%.1lf\n",h[a][b]);
}
}
void cpy(int m,int n,double a[m][n],double b [m][n])
{
int d,c;
for(d=0;d<m;d++)
{
for(c=0;c<n;c++);
b[d][c]=a[d][c];
}
}
目的是把num1中的数字复制到num2中并输出,但是num2输出了乱码。。。。真看不出来是咋回事。。