请阅读评论。 将数组元素与其大小相乘的程序。 #define s 5 #include< ; stdio.h> void mul(int * p) { for(int i = 0; i< s; i ++) { printf("%d",* p * s); p ++; } } main() { int a [s ],i; printf(" Enter%d No.",s); for(i = 0; i< s; i ++) scanf("%d"& a [i]); mul(a); / *它应该是mul(& a)为什么不呢?* / 返回0; }
Please read the comments. Program to multiply the elements of an array with its size. #define s 5 #include<stdio.h> void mul(int *p) { for(int i=0;i<s;i++) { printf("%d ",*p*s); p++; } } main() { int a[s],i; printf("Enter %d No. ",s); for(i=0;i<s;i++) scanf("%d",&a[i]); mul(a);/* it should be mul(&a) why not?*/ return 0; }
推荐答案Umesh写道: Umesh wrote: 请阅读评论。 Please read the comments.
当你学会正确编写main时,请回来。
Come back when you learn how to write main correctly.
> main() > main()- Ian Collins。
-- Ian Collins.
Ian Collins说: Ian Collins said: Umesh写道: Umesh wrote: >请阅读评论。 >Please read the comments.
当你学习如何正确编写main时,请回来。
Come back when you learn how to write main correctly.
>> main() >>main()
什么''这是不正确的? - Richard Heathfield Usenet是一个奇怪的地方 - dmr 29/7/1999 www.cpax.uk 电子邮件:rjh在上述域名, - www。
What''s incorrect about that? -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 www.cpax.uk email: rjh at the above domain, - www.
6月17日下午12:40,Richard Heathfield< ; r ... @ see.sig.invalidwrote: On Jun 17, 12:40 pm, Richard Heathfield <r...@see.sig.invalidwrote: Ian Collins说: Ian Collins said: Umesh写道: Umesh wrote: 请阅读评论。 Please read the comments.
当你学习如何正确编写main时,请回来。 Come back when you learn how to write main correctly.
main() main()
$ b $那是什么意思?
What''s incorrect about that?
理想情况下应该是 int main(无效) 谢谢
Ideally that should be int main(void) thanks
> - Richard Heathfield Usenet是一个奇怪的地方 - dmr 29/7 / 1999http://www.cpax.uk 电子邮件:rjh在上述域名, - www。 > -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999www.cpax.uk email: rjh at the above domain, - www.
更多推荐
指针歧义
发布评论