二维数组 简单的复制数组 输出数字乱码 帮帮我
#include <stdio.h>void copy (double sou[][2],double (*tar)[2], int);
int main (void)
{
double source[2][2]={
{1.1,2.2},{3.3,4.4}
};
double target[2][2];
int n,m;
copy (source,target,2);
for (n=0;n<2;n++)
for (m=0;m<2;m++)
printf ("%.1lf ",target[n][m]);
return 0;
}
void copy (double sou[][2],double (*tar) [2], int n)
{
int m,x;
for (x=0;x<n;n++)
for (m=0;m<2;m++)
tar[x][m]=sou[x][m];
}