隐含的功能错误声明 [英] Implicit Declaration of Function Error

查看:78
本文介绍了隐含的功能错误声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对编码很新,所以这是一个新手问题。我正在尝试使用函数而不是main来打印横幅:

Hi, I''m very new to coding, so this is a newbie question. I''m trying to print out a banner using functions instead of main:

展开 | 选择 | Wrap | 行号

推荐答案

As据我所知,函数被调用并在那里正确定义(虽然我认为你不需要参数列表中的''void'')。您是否在您的包含(主要上方)下定义了原型?你也声明int main但不返回任何东西。尝试添加''返回0;在你的banner1()调用之下。
As far as I can tell, the function is called and defined properly there (though i don''t think you need the ''void'' in the parameter list). Do you have a prototype defined under your includes (above your main)? You also declare int main but don''t return anything. Try adding ''return 0; below your banner1() call.



据我所知,函数被调用并在那里正确定义(虽然我不知道我认为你需要参数列表中的''void''。您是否在您的包含(主要上方)下定义了原型?你也声明int main但不返回任何东西。尝试添加''返回0;在你的banner1()调用下面。
As far as I can tell, the function is called and defined properly there (though i don''t think you need the ''void'' in the parameter list). Do you have a prototype defined under your includes (above your main)? You also declare int main but don''t return anything. Try adding ''return 0; below your banner1() call.



我包括iostream,iomanip和cmath(整个程序很长,但横幅是现在的保留)。


我添加了return 0;,但结果与之前相同。

I include iostream, iomanip, and cmath (the entire program is pretty long, but the banner is the holdup for now).

I added "return 0;", but with the same results as before.


您是否添加了原型并从中删除了实现的参数列表?
Did you add the prototype and remove void from the parameter list of the implementation?


这篇关于隐含的功能错误声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆