c语言中,为什么总是说我自定义函数的调用的参数太少

2025-04-16 14:47:03101 次浏览

最佳答案

首先要知道Dev-C++只是一个IDE。它并不自己实现编译器,而是默认搭配MinGW版GCC编译器。When C doesn't find a declaration, it assumes this implicit declaration: int f();, which means the function can receive whatever you give it, and returns an integer. If this happens to be close enough (and in case of printf, it is), then things can work. In some cases (e.g. the function actually returns a pointer, and pointers are larger than ints), it may cause real trouble。

GCC只是默认还允许implicit function declaration功能而已,较新的C规范(C99、C11)是不允许不声明直接用的。

声明:知趣百科所有作品均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请在页面底部查找“联系我们”的链接,并通过该渠道与我们取得联系以便进一步处理。