< iostream>与< iostream.h>对“iostream.h” [英] <iostream> vs. <iostream.h> vs. "iostream.h"

查看:136
本文介绍了< iostream>与< iostream.h>对“iostream.h”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在C ++中包含头文件时,...

When including a header file in C++, what's the difference between...

1)包含.h,而不是包含.h ; >标志?

1) including the .h versus not including the .h when wrapping it in < > signs?

#include <iostream> vs. #include <iostream.h>

2)用双引号将标题名称括起来, >迹象?

2) wrapping the header name in double quotes versus wrapping it in < > signs?

#include <iostream.h> vs. #include "iostream.h"

提前感谢!

推荐答案

简而言之:

iostream.h已弃用 - 它是原始的Stroustrup版本,iostream是标准委员会的版本。通常编译器把它们都指向同一个东西,但是一些旧的编译器不会有旧的编译器。在一些奇怪的情况下,它们都将存在并且不同(以支持旧代码),然后必须具体。

iostream.h is deprecated - it is the original Stroustrup version, and iostream is the version from the standards committee. Generally compilers point them both to the same thing, but some older compilers won't have the older one. In some odd cases they will both exist and be different (to support legacy code) and you then must be specific.

对比<>只是检查本地

"" versus <> simply means check the local directories for the header before going to the library (in most compilers).

这篇关于&lt; iostream&gt;与&lt; iostream.h&gt;对“iostream.h”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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