程序老是报错 `a' was not declared in this scope10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数来显示数组的内容,

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/04 00:19:49
程序老是报错`a''wasnotdeclaredinthisscope10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数

程序老是报错 `a' was not declared in this scope10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数来显示数组的内容,
程序老是报错 `a' was not declared in this scope
10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数来显示数组的内容,再编写另一个函数执行翻倍功能.数组名和数组行数作为参数由程序传递给函数.
#include
#include
#define SIZE1 3
#define SIZE2 5
void mul(int a,int b,double arr[a][b]);
void echo(int a,int b,double arr[a][b]);
int main(void)
{
double one[SIZE1][SIZE2] =
{
{1.1,2.2,3.3,4.4,5.5},
{6.6,7.7,8.8,9.9,10.10},
{11.11,12.12,13.13,14.14,15.15}
};
echo(SIZE1,SIZE2,one);
mul(SIZE1,SIZE2,one);
echo(SIZE1,SIZE2,one);
system("pause");
return 0;
}
void mul(int a,int b,double arr[a][b])
{
int i,n;
for(i = 0;i < a;i++)
{
for(n = 0;n < b;n++)
arr[i][n] *= 2;
};
}
void echo(int a,int b,double arr[a][b])
{
int i,n;
for(i = 0;i < a;i++)
{
printf("\n[%d]\n",i);
for(n = 0;n < b;n++)
printf("%7lg",arr[i][n]);
};
}
编译器用的是dev c++,
5:error:`a' was not declared in this scope
5:error:`b' was not declared in this scope
6:error:`a' was not declared in this scope
6:error:`b' was not declared in this scope
In function `int main()':
6:error:too many arguments to function `void echo(int,int)'
16:error:at this point in file
5:error:too many arguments to function `void mul(int,int)'
17:error:at this point in file
6:error:too many arguments to function `void echo(int,int)'
18:error:at this point in file
At global scope:
22:error:`a' was not declared in this scope
22:error:`b' was not declared in this scope
In function `void mul(int,int)':
28:error:`arr' undeclared (first use this function)
28:error:(Each undeclared identifier is reported only once for each function it appears in.)
At global scope:
31:error:`a' was not declared in this scope
31:error:`b' was not declared in this scope
In function `void echo(int,int)':
38:error:`arr' undeclared

程序老是报错 `a' was not declared in this scope10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数来显示数组的内容,
经我用devcpp测试发现应该定义成
void mul(int a,int b,double arr[][SIZE2])
void echo(int a,int b,double arr[][SIZE2])
你写的不是变长数组,因为你用的SIZE1 和SIZE2是宏,宏在预处理的时候都会被换成原本的.也就是说:预处理后,SIZE1变成了3,SIZE2变成了5,这些可以在预处理后的代码里看到.

程序老是报错 `a' was not declared in this scope10.编写…个程序,声明一个3x5的数组并初始化,具体数值可以随意.程序打印出数值,然后数值翻1番,接着再次打印出新值.编写一个函数来显示数组的内容, 系统老是报错, matlab报错Function definitions are not permitted at the prompt or in scripts.麻烦帮修改程序能运行这是我的程序function []=expand(q,a,d,t,v0)R=(q*t/(a*pi/6+5000*pi))^(1/3);q=1;a=14363.384;d=0.3;t=100000;v0=3.6;for i=0:24:t/3600if (d*( after effect AE3d export 怎么用?为什么老是报错? after effects老是报错,到底是怎么回事啊? 【 】 from his parents for a long time he was worried about themA not hearing B heard not D not heard 这三个选项哪里错了 was 部署后多并发操作报sybase encountered a deadlock situation.Please re-run your command.使用TOMCAT操作时,并发都没报这个错,在was中使用JNDI并发就报.org.hibernate.exception.LockAcquisitionException:could not insert:cause b -surprised me most was that there was not not a car in this______ surprised me most was that there was not not a car in this European ancient town.A .Which B.AS C.What D.It 电子狗老是报kfi雷达, android log类Log.d(tag,...onFling...); 这个是从别人那考的代码.看不懂.为什么tag老是报错. Not having finished his homework,____to watch TV. A.his mother forbade him B.so he was not allowed C.and he was not allowed D.he was not allowed 答案是D,为什么!求详细的解释,谢谢! Not having finished his homework,____to watch TV.A.his mother forbade him B.so he was not allowed C.and he was not allowed D.he was not allowed 为什么A是妈妈为主语 为什么A不行? Nothing he did was right,__? A)was it B)did it C)was not it D) did not it 谢谢 有关重要性水平审计问题被审计单位应收账款金额为300万元,重要性水平为2万元,现对其中50%进行抽查,发现0.95万元的错报,注册会计师应当?A 确认其金额 B 追加审计程序 C 扩大审计程序 D 建议 How was your trip to Beijing?A.Not bad B.Not really C.Not well D.Not worse为什么要选择A Tony was very angry at_____to a higher position.A.I not promoting B.my not being promotedC.not me being promoted D.not promoted 为什么程序老是没有响应? But it was ___ cold yesterday.(阅读)A.much B.not C.a bit D.more