C ++函数声明(C++ function declarations)
我是C ++的新手。 我不明白为什么它是可以的(即为什么编译器允许它)1个函数被声明两次。 例如,以下代码是合法的:
#include <iostream> #include <string> int hello(); int hello(); int main(){ cout << "hello, world" << endl; } int hello(){ return 1; }
为什么编译器不抱怨?
I'm a newbie to C++. I don't understand why it is okay (i.e. why the compiler allows it) for 1 function to be declared twice. For example, the following code is legal:
#include <iostream> #include <string> int hello(); int hello(); int main(){ cout << "hello, world" << endl; } int hello(){ return 1; }
Why does the compiler not complain?
原文:https://stackoverflow.com/questions/16642027
更新时间:2022-03-17 16:03
最满意答案
您是否尝试过以下解决方案?
1.Select the right project 2.Choose "project"on the tool bar -> Properties 3.Click "Builders" in the menus of the popped up window 4.Remove the missing builders
Have you tried the following solution ?
1.Select the right project 2.Choose "project"on the tool bar -> Properties 3.Click "Builders" in the menus of the popped up window 4.Remove the missing builders
相关问答
更多-
android 3d游戏开发 所需要的软件[2023-10-23]
eclipse -
安卓应用程序开发使用哪个开发工具最好?[2022-11-21]
eclipse -
安卓手机编程现在用什么软件?并求下载地址。[2022-05-06]
eclipse -
你一定有正确的依赖关系 ? 你安装了哪个eclipse版本? 哪个JRE / JDK用于运行eclipse? Bad version number意味着预期的目标java版本和你使用的版本不一致(见这里 )。 You sure to have the correct dependencies? Which eclipse version do you have installed? Which JRE/JDK is used to run eclipse with? Bad version number m ...
-
构建工作区是关于在当前使用的工作区中的一个已打开的项目中检测到的任何进化的增量构建。 您还可以通过菜单“ Project / Build automatically ”来禁用它。 但是我建议先查一下: 如果项目清除所有/构建结果在同一种长时间的等待(禁用此选项后) 如果你有这样一些验证选项,你可以禁用它,看看它们是否对全局编译时间有影响(如果你安装了WTP,那么Preferences / Validations ,或者是Preferences / XML / ... ) 如果引用相同工作空间的新eclips ...
-
您是否尝试过以下解决方案? 1.Select the right project 2.Choose "project"on the tool bar -> Properties 3.Click "Builders" in the menus of the popped up window 4.Remove the missing builders 参考链接 Have you tried the following solution ? 1.Select the right project 2.Choose ...
-
看到这个线程并在eclipse.ini明确定义vm路径(就像在这个中一样)。 -vm C:/Prog/Java/jdk1.6.0_21/jre/bin/server/jvm.dll (调整路径和Java版本号)。 这应该可以解决问题。 See this thread and define explicitly the vm path in your eclipse.ini (like in this one). -vm C:/Prog/Java/jdk1.6.0_21/jre/bin/server/jvm ...
-
在Helios下开发的Eclipse插件没有在Juno中显示(Eclipse plugin developed under Helios doesn't show in Juno)[2023-06-08]
首先,您应该检查是否找到了插件。 然后你应该检查插件是否已经解决,即是否满足所有要求。 如果您有Eclipse的插件开发版本,那么您可以打开插件注册表视图。 看看你的插件是否在列表中,如果是,那么至少找到它。 然后右键单击它,启用高级操作,然后选择诊断。 有些要求可能尚未实现。 如果您没有Eclipse的插件版本,则可以使用osgi控制台。 转到控制台视图,然后在视图菜单中选择OSGI控制台。 运行命令ss列出所有插件,以及diag 123 ,其中number是你的插件的id来诊断它。 另外, 请参阅之前对 ... -
您是否在错误日志中看到“打开文件太多”消息? 在网上快速搜索显示,如果打开的jar文件太多,通常会弹出此消息。 尝试将以下行添加到configuration \ config.ini文件中,看看它是否有帮助: osgi.bundlefile.limit = 100 Ah... It's wrong binaries. I have downloaded the one for 64bit instead of 32 bit. My bad. :-)
-
您应该删除指向文件的存储库:/ C:/eclipse3.6/在可用软件站点中 (在首选项 - >安装/更新下)。 删除后,您可以在Work with: url中输入地址: http : //opensocial-development-environment.googlecode.com/svn/update-site/site.xml,然后按Enter键。 如果它不起作用(它对我不起作用,但可能是因为这里糟糕的互联网连接),你可以随时下载jar并将它们放在c:/eclipse3.6/plugins下。 Y ...