指针歧义

编程入门 行业动态 更新时间:2024-10-25 14:31:13
本文介绍了指针歧义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请阅读评论。 将数组元素与其大小相乘的程序。 #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.

更多推荐

指针歧义

本文发布于:2023-11-07 06:45:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565798.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:歧义   指针

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!