一个奇怪的编译异常,头文件包含有关问题

一个奇怪的编译错误,头文件包含问题?
本帖最后由 coolboylai2 于 2013-01-24 10:26:19 编辑
#include<stdio.h>
#include<queue>
using namespace std;[/i]如果是把这个更改为#include<queue.h> 用DEV C++就会出现编译错误[i]

int main()
{
    queue<int> Q;
    int n,temp;
    scanf("%d",&n);
    while(n--)
    {
      scanf("%d",&temp);
      Q.push(temp);
    }
    while(!Q.empty())
    {
     char c = Q.front();
     Q.pop();
     printf("%c",c);
    }
    //getchar();
   // getchar();
    return 0;
}
编译提示信息是这样的
2 C:\Dev-Cpp\include\c++\3.3.1\backward\queue.h:31,               from C:\Users\laicb\Desktop\机试\CPP\ASCII.cpp In file included from C:/Dev-Cpp/include/c++/3.3.1/backward/queue.h:31,               from C:/Users/laicb/Desktop/机试/CPP/ASCII.cpp 

2 C:\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. 
c++ 编译错误  头文件 

------解决方案--------------------
标准库中的头文件
C++标准库中的一切内容都被放在名字空间std中(名字空间中的内容对外是不可见的),但是带来了一个新问题,无数现有的C++代码都依赖于使用了多年的伪标准库中的功能,如声明在<iostream.h>等头文件中的功能,使用std包装标准库导致现有代码的不可用,为了兼容这种情况,标准委员会为包装了std的那部分标准库创建了新的头文件,新的头文件的文件名与旧的一样,只是没有.h这个后缀,如<iostream.h>就变成了<iostream>。对于C头文件,采用同样的方法,但还在每个头文件名前加了字符c,如<string.h>就变成了<cstring>,<stdio.h>变成了<cstdio>。最好使用新的文件头,使用新的文件头的C++程序,需要使用using namespace std或者using namespace std::指定的类名,等方法来使需要的类对于我们的代码可视。
------解决方案--------------------
#include<queue>
using namespace std;
这个是新标准,

为了兼容就的标准,依然支持#include<queue.h>这种写法,如果这种引用方法,你就按照旧的函数调用方法调用,试着不要用命名空间这东西了。

再者,你的这个文件queue.h确实存在么?,我的是没有这个。
------解决方案--------------------
现代C++推荐<queue>加上using namespace std;
<queue.h>只是为了向后兼容