关于Dev-C++4.9.9.0问题求教:

huangliguo 2004-10-15 09:09:17
在Dev-C++4.9.9.0运行程序不通过:

#include<iostream.h>
void main()
{
cout<<"hello.\n";
cout<<"I am a student.\n";
}

错误信息:
1 d:\Dev-Cpp\include\c++\3.3.1\backward\iostream.h:31, from D:\Dev-Cpp\lizi\1.1.cpp In file included from d:/Dev-Cpp/include/c++/3.3.1/backward/iostream.h:31, from D:/Dev-Cpp/lizi/1.1.cpp
1 D:\Dev-Cpp\lizi\1.1.cpp from D:/Dev-Cpp/lizi/1.1.cpp
2 d:\Dev-Cpp\include\c++\3.3.1\backward\backward_warning.h:32 #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
3 D:\Dev-Cpp\lizi\1.1.cpp `main' must return `int'


这是为什么呢?
谁有Dev-C++4.9.9.0用法介绍吗
...全文
186 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangfjj 2004-10-15
  • 打赏
  • 举报
回复
#include<iostream.h> 这是老标准的头文件写法

void main() 同样新标准要把main()定义的int型
dev-c++跟新标准比较紧,
所以才出现你这样的问题。
Dong 2004-10-15
  • 打赏
  • 举报
回复
#include<iostream.h>
void main()
{
cout<<"hello.\n";
cout<<"I am a student.\n";
}
-----
其实这样的代码是正确的,cout包含在iostream.h了,不过格式不被提倡而已。

你的问题是编译器的问题(没有设置好环境或者其他的问题···反之不是程序的问题)
ZKYcomputer 2004-10-15
  • 打赏
  • 举报
回复
在vc下可以啊
hcj2002 2004-10-15
  • 打赏
  • 举报
回复
呵呵

同意 renheihei(嘿嘿)

insulator 2004-10-15
  • 打赏
  • 举报
回复
楼主要学一学标准c++
楼上的写得不错
renheihei 2004-10-15
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;
int main()
{
cout<<"hello.\n";
cout<<"I am a student.\n";
system("pause");
}

64,690

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧