DEV--C++ 问题

来源:百度知道 编辑:UC知道 时间:2024/05/11 14:59:13
为什么我用 #include <iostream.h> 定义后.无法编译通过呢?

#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 <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.

这里是不是要设什么东西呀? 如果是 要怎么设呢?

在标准C++中已经明确指出不提倡使用带有.h的头文件,应该这样:

把#include <iostream.h>改为:
#include <iostream>并加上using namespace std;

区别是,不带有.h的头文件是被包含在std名字空间中的,而带有.h的头文件没有名字空间。

#include<iostream>
using namespace std;
int main()
{cout<<"djgdk"<<endl
system("pause");
return 0;
}
基本格式